Servo Shield Behaving Erratically

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Servo Shield Behaving Erratically

Post by hex4d617474 »

Hello,
I have a 16 channel 12c arduino shield servo driver ( http://learn.adafruit.com/adafruit-16-c ... d/overview ). I received it as a gift for Christmas, and assembled it, only to find that it is not working correctly. The red and green LEDs are on. I uploaded the example code that came with the library to my arduino.

Code: Select all

/*************************************************** 
  This is an example for our Adafruit 16-channel PWM & Servo driver
  Servo test - this will drive 16 servos, one after the other

  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/products/815

  These displays use I2C to communicate, 2 pins are required to  
  interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);

// Depending on your servo make, the pulse width min and max may vary, you 
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#define SERVOMIN  150 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX  600 // this is the 'maximum' pulse length count (out of 4096)

// our servo # counter
uint8_t servonum = 0;

void setup() {
  Serial.begin(9600);
  Serial.println("16 channel Servo test!");

  pwm.begin();
  
  pwm.setPWMFreq(60);  // Analog servos run at ~60 Hz updates
}

// you can use this function if you'd like to set the pulse length in seconds
// e.g. setServoPulse(0, 0.001) is a ~1 millisecond pulse width. its not precise!
void setServoPulse(uint8_t n, double pulse) {
  double pulselength;
  
  pulselength = 1000000;   // 1,000,000 us per second
  pulselength /= 60;   // 60 Hz
  Serial.print(pulselength); Serial.println(" us per period"); 
  pulselength /= 4096;  // 12 bits of resolution
  Serial.print(pulselength); Serial.println(" us per bit"); 
  pulse *= 1000;
  pulse /= pulselength;
  Serial.println(pulse);
  pwm.setPWM(n, 0, pulse);
}

void loop() {
  // Drive each servo one at a time
  Serial.println(servonum);
  for (uint16_t pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) {
    pwm.setPWM(servonum, 0, pulselen);
  }
  delay(500);
  for (uint16_t pulselen = SERVOMAX; pulselen > SERVOMIN; pulselen--) {
    pwm.setPWM(servonum, 0, pulselen);
  }
  delay(500);

  servonum ++;
  if (servonum > 15) servonum = 0;
}[size=85][/size]
The servo turns when I wiggle it around, but does not continue rotating when I plug it in completely. Output from serial monitor: "16 channel Servo test!" Anything I can try?

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

I have an MP4 video file of my project, but forum software not allowing me to upload it

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Servo Shield Behaving Erratically

Post by Franklin97355 »

If you could post clear pictures of both sides of the board and a description of how you have things connected it would help. What are you using to power the servos?

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

Thats the problem. I can't attach any files to my posts. I'm using two AA battery packs with rechargeable batteries, getting a reading of 5.49VDC on the power input of the shield. I haven't put a capacitor on the shield.

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

I posted the video to GooglePlus, my name is Bill Shoemaker

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo Shield Behaving Erratically

Post by adafruit_support_bill »

Photos can be posted via the "upload attachment" tab under the message box. There is a 1 meg limit. If you resize your images to 800x600 you should have no problems.

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

Here's a picture of it
Attachments
FAMILYLAPTOP - WIN_20131231_152624.JPG
FAMILYLAPTOP - WIN_20131231_152624.JPG (153.84 KiB) Viewed 550 times

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

the wires going off the screen go to a "Tower Pro MG90S" servo

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo Shield Behaving Erratically

Post by adafruit_support_bill »

Please post some photos that clearly show the soldering on both the front and back of the shield. The behavior you describe is consistent with an intermittent connection.

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

pic1
Attachments
0103140940-00.jpg
0103140940-00.jpg (736.24 KiB) Viewed 523 times

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

pic2
Attachments
0103140941-01.jpg
0103140941-01.jpg (702.48 KiB) Viewed 522 times

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo Shield Behaving Erratically

Post by adafruit_support_bill »

Very few of your solder joints have flowed onto the solder pad. These will not make reliable contact. The profile of the solder joint should look like the diagram below. Please refe to this guide for tips on fixing these joints: http://learn.adafruit.com/adafruit-guid ... n-problems

Image

critopadolf
 
Posts: 9
Joined: Sun Jan 05, 2014 4:45 pm

Re: Servo Shield Behaving Erratically

Post by critopadolf »

i am using the same shield, and having the same problem and im trying to fix the soldering now, how do i remove the excess solder?

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo Shield Behaving Erratically

Post by adafruit_support_bill »

i am using the same shield, and having the same problem and im trying to fix the soldering now, how do i remove the excess solder?
A solder-sucker or solder wick can remove excess solder. If you can post some photos, we might be able to offer some more specific advice.

Check out this page for tips on fixing many types of solder problems - http://learn.adafruit.com/adafruit-guid ... n-problems

User avatar
hex4d617474
 
Posts: 23
Joined: Mon Dec 30, 2013 7:56 pm

Re: Servo Shield Behaving Erratically

Post by hex4d617474 »

Sorry for taking so long, but school has prevented me from working on the shield until recently. When I first looked at the shield again, I realized what a horrible job I did the first time. The headers were barely attached, they moved when I wiggled them! I re-soldered all the joints, and the shield is working great now. Thanks for your help!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”