I've just assembled one of two of these boards and am not having much luck with it. I've attached a 5v 2amp power supply for the servos and have triple checked my i2c and power connections to my Arduino Uno. When I plug in the servo power supply I can measure 5v across the GND and V+ pins. When I plug in USB power to the arduino the power led on the board lights up. Compiling and uploading the sketch works fine and when I bring up the serial monitor I can see the sketch running through each of the pwm ports. However the servo never moves and it doesn't matter which port I attach it to. I've tried a few different servos as well with the same result.
Does anyone have tips about how to further troubleshoot this problem? I can't tell if I'm making a proper i2c connection or not. How would I measure pwm across the signal ports? I don't have an oscilliscope... just a little multimeter.
I'll try assembling the second board next and I suppose if that one works it will tell me that the first one is defective.
Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Post photos showing your soldering and connections. With a multimeter, you might see something between the GND and signal pin. But the pulses are short, and depending on how your meter integrates, it is hard to say what if anything it will read.
What code are you using to test?
What code are you using to test?
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Here is a photo of the connections. The servo power is connected correctly... verified by the multimeter for positive and negative.
I'm using the 'servo' example in the Adafruit_PWMServoDriver library. Also, you can see in this photo that I haven't changed from the default address of the board.
I'm using the 'servo' example in the Adafruit_PWMServoDriver library. Also, you can see in this photo that I haven't changed from the default address of the board.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Here's a photo of the solder joints. I was probably a bit too generous with the solder.
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Solder looks OK, and your connections look right. Does the servo twitch a bit when you first plug it in? Does it resist turning at all? (more than when it is disconnected)
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Are you using one of our example sketches or one of your own? Are you instantiating the driver with the default address (like this), or are supplying it with an address?
You haven't shorted any of the address pads, so your I2C address will be 0x40 (the default).
Code: Select all
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
The servo occasionally twitches slightly when I plug in the servo power... but never when I plug in the Arduino or while the sketch is running.
I am using the 'servo' sketch from the library. You are correct that I haven't shorted any of the address pads so the default address should be active. The default address is supported by default in the 'servo' sketch so I didn't need to change it at all.
I've noticed there are a few serial.println commands commented out in the library and I'm wondering if it's worthwhile uncommenting them to see if they give any additional info.
I'm sitting down to assemble the second of these boards that I have. Hopefully I'll have better luck with it.
I am using the 'servo' sketch from the library. You are correct that I haven't shorted any of the address pads so the default address should be active. The default address is supported by default in the 'servo' sketch so I didn't need to change it at all.
I've noticed there are a few serial.println commands commented out in the library and I'm wondering if it's worthwhile uncommenting them to see if they give any additional info.
I'm sitting down to assemble the second of these boards that I have. Hopefully I'll have better luck with it.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
I've just finished assembling the second unit and am seeing the same problem with it. So it has to be either something I'm doing or a problem with my arduino or maybe with my power supply. I haven't used the analog 4 and 5 ports for anything yet so I think I'll cobble something up to verify that they are working.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
My Arduino is able to read a pot off both A4 and A5. That doesn't test output but does give me a reasonable confidence that the Arduino ports are okay.
Do you think my power supply could be too noisy? Maybe I need to populate the capacitor? I'm posting a pic of the power supply label. I can say that it reads 5.32 volts on my multimeter when I test it both directly and across the GND and V+ pins on the PWM driver boards.
Do you think my power supply could be too noisy? Maybe I need to populate the capacitor? I'm posting a pic of the power supply label. I can say that it reads 5.32 volts on my multimeter when I test it both directly and across the GND and V+ pins on the PWM driver boards.
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
5v@2A should be sufficient. Although I would question the regulation if you are reading 5.35.
You didn't answer one of the questions:
You didn't answer one of the questions:
Unplug the servo, rotate the servo shaft to a different position and see if it moves when you plug it in again.Does it resist turning at all? (more than when it is disconnected)
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
Sorry, forgot to try that. Unfortunately the servo is just as easy to move when plugged in as it is when not. And there is no additional movement even when moving the servo manually before powering the Arduino.
Should this chip be generating a flat (0) PWM signal by default?
I have some 5v regulators laying around. I could breadboard a regulated circuit to see if that helps. But it doesn't sound like a power supply issue now.
I'll try running the servo from an Arduino port using the same power supply next.
Should this chip be generating a flat (0) PWM signal by default?
I have some 5v regulators laying around. I could breadboard a regulated circuit to see if that helps. But it doesn't sound like a power supply issue now.
I'll try running the servo from an Arduino port using the same power supply next.
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
There should be no signal out by default. Only after you call setPWM(). In the absence of a signal, the servo will be easy to move as you report.
Testing the servo with the Arduino will rule that out as the problem. You might also add some serial.println() statements to the code to make sure that the sketch is actually running.
Testing the servo with the Arduino will rule that out as the problem. You might also add some serial.println() statements to the code to make sure that the sketch is actually running.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
The servo works fine if I feed it PWM from the Arduino (port 13). I used the servo>sweep example. This was using the same 5v power supply (with grounds tied between the Arduino power supply.)
FYI... there are already serial.println statements in the Adafruit_PWMServoDriver>servo script and if I bring up the serial monitor I can see the sketch executing through each of the ports. So it does appear to be running.
Maybe the i2c connection isn't being established? This is really the first i2c based device I've tried using. The wires are only about 6 inches long so I can't imagine there's enough capacitance on them to cause an issue. But maybe I'm getting some interference. I've got one thing to try... I'll post back in a minute.
FYI... there are already serial.println statements in the Adafruit_PWMServoDriver>servo script and if I bring up the serial monitor I can see the sketch executing through each of the ports. So it does appear to be running.
Maybe the i2c connection isn't being established? This is really the first i2c based device I've tried using. The wires are only about 6 inches long so I can't imagine there's enough capacitance on them to cause an issue. But maybe I'm getting some interference. I've got one thing to try... I'll post back in a minute.
- walker
- Posts: 77
- Joined: Sat Aug 04, 2012 8:40 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
I had to try running without my workstation light running. It's a flourescent Ott light and I thought it might be causing some power line or RF interference. But turning it off and running again didn't produce any different results.
Would it make sense to set the i2c baud rate lower to see if that makes a difference? Maybe I should try setting the PWM frequency to 50mhz?
Walker
Would it make sense to set the i2c baud rate lower to see if that makes a difference? Maybe I should try setting the PWM frequency to 50mhz?
Walker
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver not driving servos
With 6" jumpers noise or capacitance should not be an issue. But do double check that all connections are firmly seated.
Another thing to check - I was seeing the same behavior (or lack of behavior) here on a couple of PWM boards here on the bench. The servo wasn't moving and there was nothing on the scope. Then I hit the reset button on the UNO and everything started working.
Another thing to check - I was seeing the same behavior (or lack of behavior) here on a couple of PWM boards here on the bench. The servo wasn't moving and there was nothing on the scope. Then I hit the reset button on the UNO and everything started working.
Please be positive and constructive with your questions and comments.