Certain Servos Not Rotating; Yet Are Being Given Values To Rotate To

I am in the final stages of creating an 'Inmoov Robotic Hand'. It's a 3D printed robotic hand controlled by flex sensors which a certain servo reenacts.

The servos are directly powered through the DC power supply, while the flex sensors are powered through the Arduino 5v.

Some servos read the values of the flex sensors well (which are flex sensors #17 , #24 and #34 ) and some do not (which are #30 and #38 ). Although it reads and reenacts the values, flex sensor #34 is very odd as it draws a max of 3.6Amps of current during its flexion. I think the other values are being impeded by this.

All servos have had the maximum physical stopping pin removed (which had been the solution to my last problem.)
I have also redone the Vero-Board, so there are no faults with the copper, although there may be a fault in how it's wired.
a 470uf is also placed capacitor between the leading ground and 5v lead.

I do not have any CAD drawings, they will be completed next week (we were told to draw the circuit first).
Here is the Vero-Board which is connected to the arduino, the wired connection on the underside are for the A0-A4 pins for each flex sensor. The Servos are connected to the '~' connections of the arduino (being connection ~5, ~6, ~9, ~10, ~11) .

All in all, it is the servos attached to pins 10 (myservo2) and pin 3 (myservo5) , reading from Flex Sensors #38 and #30, which are simply not using the values to rotate. They stay stationary when the Sensor is flexed, and am not sure why. Flex Sensor #34 may be the cause, but I am not sure if so.

Any help would be appreciated. Thank you.

#include <Servo.h> 
 
int pos1; //Set first servo to an initial position of 0
int pos2; //Set second servo to an initial position of 0
int pos3; //Set third servo to an initial position of 0
int pos4; //Set fourth servo to an initial position of 0
int pos5; //Set fifth servo to an initial position of 0

Servo myservo1;  // create 1st servo object to control a servo 
Servo myservo2; // create 2nd servo object to control a servo 
Servo myservo3; // create 3rd servo object to control a servo 
Servo myservo4; // create 4th servo object to control a servo 
Servo myservo5; // create 5th servo object to control a servo 


          

void setup() 
{ 
    
  Serial.begin(9600);
  myservo1.attach(9);  // attaches servo on pin 9 to the servo object 
  myservo2.attach(10); //attaches sevo on pin 10 to the servo object
  myservo3.attach(6); //attaches sevo on pin 6 to the servo object
 myservo4.attach(11); //attaches sevo on pin 11 to the servo object
 myservo5.attach(3); //attaches sevo on pin 3 to the servo object
                                   
} 

 
 
void loop() 
{ 
  
 
    //This is the programming for #24 flex sensor

    int flex1 = analogRead(A1) - 680;

    pos1 = map(flex1, 0, 170, 0, 179);
    delay(40);
  
    myservo1.write(pos1);              // tell servo to go to position in variable 'pos1' 
    delay(40);                       // waits 15ms for the servo to reach the position 
    

   
   //////////////////////////////////////////////////////////////////////////////////////////
   
   
   
     
    //This is the programming for #38 flex sensor

    int flex2 = analogRead(A2) - 690;

    pos2 = map(flex2, 0, 270, 0, 179);
    delay(40);
  

    myservo2.write(pos2);              // tell servo to go to position in variable 'pos2' 
    delay(40);                       // waits 15ms for the servo to reach the position 
    

   
   
   //////////////////////////////////////////////////////////////////////////////////////////
   
   
   
   
   
    //This is the programming for #34 flex sensor   

    int flex3 = analogRead(A3) - 610;

    pos3 = map(flex3, 0, 140, 0, 179);
    delay(40);

    myservo3.write(pos3);              // tell servo to go to position in variable 'pos3' 
    delay(40);                       // waits 15ms for the servo to reach the position 
        
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////
       
   
   
   
   
    //This is the programming for #17 flex sensor   
    
    myservo4.write(0);

    int flex4 = analogRead(A0) - 600;

    pos4 = map(flex4, 0, 170, 0, 179);
    delay(40);

    myservo4.write(pos4);              // tell servo to go to position in variable 'pos4' 
    delay(40);                      // waits 15ms for the servo to reach the position 
    
    
    
   
    
    //////////////////////////////////////////////////////////////////////////////////////////
           
   
   
   
   
    //This is the programming for #30 flex sensor   
  int flex5 = analogRead(A4) - 655;

   pos5 = map(flex5, 0, 235, 0, 179);
   delay(40);
  

   myservo5.write(pos5);              // tell servo to go to position in variable 'pos5' 
   delay(40);                       // waits 15ms for the servo to reach the position 
    
    
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////
    
    
   Serial.println(flex1);
   Serial.print("      ");
   Serial.print(flex2);
   Serial.print("      ");
   Serial.print(flex3);
   Serial.print("      ");
  Serial.print(flex4);
  Serial.print("      ");
  Serial.print(flex5);
   Serial.print("      ");
     
delay(30);   

}

Here's the side view of the board.

It is soooooooooooooooooooo annoying that you have asked this question in 3 places.....

This...

Some servos read the values of the flex sensors

..... makes absolutely no sense. Servos don't read values from sensors. What are you trying to say?

Here's some thoughts:

  • I see the last lines of your code print the flex"n" values which is a good idea: are they correct? While you're at it, you could print the pos"n" values too, just to make sure the values are all ok.

  • You could do some debugging by hard coding some servo movements in there, and comment out the lines where it uses the mapped sensor value. That way you'll know the servos are actually working.

  • Are those delays long enough for the servos tpo move to their positions?- don't forget how fast it zooms through loop() so those sensors are being read frequently and re-instructing the servos.

  • You could give the sensors an external supply I guess. (Connect the ground from there to the Arduino.)

  • Lastly, do you really expect anyone to see what's going on in that cr@ppy drawing? Maybe you haven't the means to do a cad drawing, fair enough, but you should really take the time to draw the circuit properly by hand.

Are these standard rc servos ?
So you have a servo tester ? (sold in hobby stores)
Have tried running the servo example sketch on the suspect servo ?
Have you removed the servo for testing outside the system to see if it moves ?
Do you know how to replace the gears (plastic or metal) using the gear replacement sets sold in hobby stores. I've never seen a servo I couldn't repair with them.

This shows the down side of cross posting.

Now you have two different answers (this one and mine elsewhere) to the exact same question in two different threads.

Mess cleaned up. @deagle, do not cross-post again.

Some servos read the values of the flex sensors well (which are flex sensors #17 , #24 and #34 ) and some do not (which are #30 and #38 ). Although it reads and reenacts the values, flex sensor #34 is very odd as it draws a max of 3.6Amps of current during its flexion. I think the other values are being impeded by this.

.... makes absolutely no sense. Servos don't read values from sensors. What are you trying to say?

Amen

Is the layout attached correct for one sensor and one servo? (although maybe not on the correct Arduino pins)

servo and flexi- small pic.bmp (171 KB)

flex sensor #34 is very odd as it draws a max of 3.6Amps of current during its flexion

i'd say that was the problem. You say its being powered from the arduino 5v, surely that shuts the whole thing down with a consumption like that.

I would check that the sensor is working by letting it control another servo, and then check the suspect servo with another sensor,

I am shocked that you would try to power so many servos from a little tiny onbord regulator.

You need to do your homework before you go into the lab.

flex sensor #34 is very odd as it draws a max of 3.6Amps of current during its flexion.

If the flex sensor itself pulls that much current, something is bad wrong with it and it might catch on fire! You can get a little more performance from your 7805 chip by using a diode like below. Bottom is some multi servo test code you can try to test the servos. Disconnect the sensors and send the servos commands from the serial monitor.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}