[Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontrolle

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

[Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontrolle

Post by Shiki225 »

Hello,

I purchased this shield and was wondering how much voltage can this motor shield take in. Can this shield take 12V from an adaptor? Because right now I have an adapter that supplies 12V and 5A (https://www.adafruit.com/products/352). And I want to use it for the micro controller (https://www.adafruit.com/products/1411#Description) to power 6 Servo Motors. The shield says to apply 5-6V to screw terminal. The servo motors (http://www.servocity.com/html/hs-625mg_ ... 1YCzeZdVFp) are rated at 4.8 to 6V operational. So I was wondering would that be a problem using a 12V adaptor on a motor shield that wants only 5-6V to power servo motors? I see the other adafruit shields can take up to 25V or more.

Also I am wondering, if I receive 12V from the adapter to the motor shield will there be a voltage drop? Say from 12V on the adapter to 10V once it is received from the motor shield. Because I read a post about there being a voltage drop from the H-bridge from this link: http://forums.adafruit.com/viewtopic.php?f=31&t=26873

Lastly, should I be looking into a heat shield and a capacitor? Since I am running 6 high torque servos.

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

So I was wondering would that be a problem using a 12V adaptor on a motor shield that wants only 5-6V to power servo motors?
Also I am wondering, if I receive 12V from the adapter to the motor shield will there be a voltage drop?
The power applied to the external power terminal of this shield goes directly to the servo motors. There is no voltage drop. You should not supply it with any voltage higher than your servos are rated for.
Lastly, should I be looking into a heat shield and a capacitor? Since I am running 6 high torque servos.
A capacitor would be a good idea.

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

Thank you for the feedback

I am having trouble finding a suitable power supply for my setup. The 6 servos require 6V and probably 1A each since they are under a load. So, I need a power supply of 6V and 6A (or maybe even 7A?) which is uncommon to find.

I read through the "learn" sections on this site that power bricks (transformers), can actually supply more voltage than they are rated at when less amps are being drawn. So, I am concerned that if I use use a 6V brick, that they could actually burn the motors.

I am looking for something that could step down voltage and regulate it so it is steady. Would a buck converter be a good choice? such as: http://www.amazon.com/DROK-10-35V-Conve ... nverter+6v

and combined with a power brick? http://www.amazon.com/Phoenix-100-240V- ... rds=12v+6a


I also want to make sure I do not burn the 16 channel adafruit shield and the motors. I can't find any information on the max current for the shield.

If adafruit sells any products that can help me, I'd gladly look into it. I'd also appreciate any suggestions that can make the power supply setup as simple as possible :)

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

I read through the "learn" sections on this site that power bricks (transformers), can actually supply more voltage than they are rated at when less amps are being drawn. So, I am concerned that if I use use a 6V brick, that they could actually burn the motors.
This is true of many of the smaller 'unregulated' supplies. Most supplies of 1A or more do have regulation and should be safe. Good quality servos are also somewhat tolerant of overvoltages. I have HS-625MG servos running at 7.2v in several applications.
Would a buck converter be a good choice?
A buck converter could work. But it would be more efficient to use a supply designed for 6v - if you can find one with the necessary power output.
I also want to make sure I do not burn the 16 channel adafruit shield and the motors. I can't find any information on the max current for the shield.
The reverse polarity protection circuit can handle about 3A. This may be a problem for your application. You can bypass the reverse protection circuit by connecting your power directly to the 5v pin on the header. Just be sure to observe the correct polarity when doing this!

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

Hello again

I did some testing on my motors with an applied load, and each motor drew 0.4A on average. So, on average I need atleast 2.4A. I could possibly add a capacitor to help with the occasional current spike.

As long as the motors dont draw more than 3A, would this wall wart be fine? I want to be careful not to burn the reverse polarity protection. I am also assuming that 5v and 6v don't differ much in servo performance (or atleast in my application) https://www.adafruit.com/product/658

Do regulated wall warts perform well for servos? I am concerned about ripples. I am also considering motorcycle batteries but I am concerned about voltage drop as the capacity lessens and the total amount of time I can run on them

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

That supply should work for you. The DC motors in your servos will create more noise on the line than you will get from the switching supply. At 5v you will get slightly less speed and torque from your servos. But most servos run fine on that voltage.

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

You have been a great help and I appreciate it! I just have a few more things I want to clear up :)

1. Can you explain to me where the reverse polarity protection circuit is located? Is it a part of the terminal block itself?

2. Does the 'barrel jack to screw terminal' you sell have a current limit? This one:
https://www.adafruit.com/products/368

3. What is the purpose of adding an extra capacitor in C2? Is it meant to discharge when the load(servos) have sudden current peaks that the power supply isn't rated for? Or for protecting the servos from "surge" during startup? (The latter was brought up to me by a friend, and I'm not even sure if this "surge" is true). I did notice that my servos did not like the "0" and "180" degree end positions, which caused them to draw 1.5A each! I could easily program around these two locations, but maybe a capacitor would help in this case. I am currently looking at using a 6v 3.8A SMPS.

4. Seeing as I am running 6 servos drawing 2.4A total on average, would it be necessary to add a heat sink to the shield?

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

1) The reverse polarity protection MOSFET is the 3-pin device right next to C2.
2) There is no manufacturer spec for it, but Most similar devices are good for about 5A.
3) The capacitor does help with startup current surges. If you are seeing big peaks at 0 and 180, you may be hitting the stops. Adjust your min and max limits in software so that you don't hit the stops. This can be damaging to the servo.
4) The only device that would benefit from a heat-sink is the reverse current protection MOSFET. But that is only good for about 3A anyway, so you are better off bypassing it (taking care to assure the correct polarity of course). Looking back at my previous recommendation I said:
You can bypass the reverse protection circuit by connecting your power directly to the 5v pin on the header.
This is true for the servo breakout board. https://www.adafruit.com/products/1429
It is not true for the servo shield: https://www.adafruit.com/product/1411
If you are using the shield version, the best way to bypass the MOSFET is to connect the positive terminal of your power supply to the hole marked "+" for C2.

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

Hello,

General shield programming question

For a given code that is written to control servos on an Arduino Uno (and works for given pwm pins), would any extra library or commands be needed when the shield is stacked onto the Uno?

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

Since the shield has its own on-board PWM source, it uses a different library. https://learn.adafruit.com/adafruit-16- ... it-library

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

Thank you, I looked through the examples and i could not find anything on serial ports.

Is there something similar to serial.read()?

And also, I was wondering if there is something similar to a myservo.write() from the Servo.h Library of Arduino because I know for this motor-shield it uses something a little different. It uses pwm.set() drive the motors but I don't want to use specify high and low pulses to specify how I want to move my motors because I am still a little confused on that. Just something similar to a myservo.write(degrees) would be very nice.

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

Thank you, I looked through the examples and i could not find anything on serial ports.

Is there something similar to serial.read()?
Not sure I understand the question. The PWM library does not use the serial ports.
Arduino serial command are defined here: http://arduino.cc/en/reference/serial
And also, I was wondering if there is something similar to a myservo.write()
You can add something like this to your code. It takes care of the pulse length calculation.

Code: Select all

void ServoWrite(int servonum, int degrees)
{
   int pulselength = map(degrees, 0, 180, SERVOMIN, SERVOMAX);
   pwm.setPWM(servonum, 0, pulselength);
}

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

So I can still use the serial commands from Arduino if I am using a motor shield, correct?

And I understand that the map() function allows me to give me the pulse length of my servo motors. But I was wondering how i can use a similar function like servo.write() when I am getting inputs from my computer through a serial port.

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

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by adafruit_support_bill »

So I can still use the serial commands from Arduino if I am using a motor shield, correct?
That is correct.
I was wondering how i can use a similar function like servo.write() when I am getting inputs from my computer through a serial port.
Just add the function I posted earlier to your code. Then call it to move your servos.

Shiki225
 
Posts: 11
Joined: Wed Mar 12, 2014 6:28 pm

Re: [Adafruit 16-Channel 12-bit PWM/Servo Driver] Microcontr

Post by Shiki225 »

Thanks for the help,

I came across another problem. In this program:
int incomingByte; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:

incomingByte = Serial.read();

// prints the value:
Serial.print("I received: ");
Serial.println(incomingByte);
}
}
I have a problem where if I input a value of 30 on my serial monitor, the program is taking my input as two inputs: 3, and 0, instead of one input: 30. Can you help fix this problem?

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

Return to “Arduino Shields from Adafruit”