Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: petrarch on March 13, 2010, 09:16:29 PM

Title: Beginner - Smoking servo
Post by: petrarch on March 13, 2010, 09:16:29 PM
So I bought two HS-81 servos to hook up to my arduino, and I wanted to test them to make sure they worked. I bought some NiMH batteries and stuck them together in battery pack. I then ran the control wire on the servo to the arduino(Pin 9). I connected the ground and power of the servo to the battery pack, the negative(black) wire of the batteries going to the black wire of the servo, and the red going to the positive(red) of the battery. I connected them with 24 gauge 'intercom' wires from radio shack, i got those because they were the only 24 gauge wires they had and I thought 22 might be too big to fit in the little servo connector thing and I saw that they were recommended for micro servos.

When I plugged it up to the power and ground the servo started emitting a plume of smoke....  :(

The servos run from 4.8V-->6V, the batteries are 1.2V each, two are 2000mAH and two are 2500mAH. The servos take 220mA without load.

Anyway, i'm just wondering where I screwed up!

Thanks for the hlep
Title: Re: Beginner - Smoking servo
Post by: Soeren on March 13, 2010, 09:42:43 PM
Hi,

If you did exactly as you describe, I see no reason for smoke.

Was it hooked up to the controller?
If so, what was the signal from that?
Did you modify the servos in any way before the smoke escaped?
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 13, 2010, 10:03:01 PM
Hey,

I didn't modify the servo in any way. At first I just connected the ground and power, but after I did I could smell the faint scent of plastic smoke, so I immediately unplugged the power and ground. I didn't see if there was smoke, and over the next few seconds convinced myself it was just the smell of the Arduino powered on.

So then I plugged in the control wire to the arudinos pin 9 and compiled this code,to upload after I powered the servo:
Code: [Select]
for(pos=0;pos<180;pos+=1)
  {
    myservo.write(pos);
    delay(15);
  }
  for(pos=180;pos>=1;pos-=1)
  {
    myservo.write(pos);
    delay(15);

where myservo is a servo from the servo.h library and pos is initalized to 0.
I powered the servo and quickly uploaded the code to the arduino. I looked to the servo to see if it was moving back and forth, but all i saw was smoke :(. I checked over the power and ground connections several times, and they seemed fine. The wire is solid core if that makes a difference...

Title: Re: Beginner - Smoking servo
Post by: Joker94 on March 13, 2010, 10:59:27 PM
from what i gather the first time you plugged it in is you have either damaged the gears and or motor or some how damaged the electronics.

A servo needs a pulse to send it to a position called a PWM(pulse with modulation). if you hooked up the 6v straight to the circuit it would have either done some thing bad to the circuitry and or to the motor and gears.

If the motor moved momenteraly the first time you applied power then i think it would have something to do with the entire thing and if it didn't move at all i think it would just be the circuitry effected.

I have never had experience with this as i have never done it. but these were my initial thoughts.
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 13, 2010, 11:06:21 PM
Thanks so much for your help. I have read all of the "recommended" tutorials on this website, so I am very very small bit familiar with how servos work.

So I guess the question is: if there is no power to the control line, does a servo keep its current angle or does it mess up the servo or does it behave in an undefined way?
Title: Re: Beginner - Smoking servo
Post by: Joker94 on March 13, 2010, 11:26:08 PM
If the servo has no external forces on it, it will hold a position. Eg, if you have a sensor on it it will hold its position

But if you have a heavier weight like a hexopod leg attached the weight of the leg will move it from its original position.

So in a nut shell, no the servo will not hold its position without a pulse. and whether it will be moved out of position depends on the weight of the object and orientation of the servo. ( on its side, upside down, face up etc.)
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 14, 2010, 12:50:41 AM
I tried the other servo with just hooking it up to the arduino and it worked perfectly...

I'm kind of tempted to run the servo off the niMHs but I don't want to throw another $17.00 down the drain.
Title: Re: Beginner - Smoking servo
Post by: Joker94 on March 14, 2010, 01:00:56 AM
its good that the arduino works and your other servo works and if i were you i wouldnt run the servo off the battery as you dont want to stuff that one up to.

If the other one doesn't work open it up and see if you can see anything wrong with it and if not, you will be able to use the motor and gears if they still work with a motor controller.
Title: Re: Beginner - Smoking servo
Post by: cyberfish on March 14, 2010, 02:24:12 AM
Have you tried measuring the battery pack voltage with a multimeter?
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 14, 2010, 09:54:57 AM
I test each batter individually as well as the pack. each battery is giving off ~ 1.25 volts for a total voltage of ~5V from the pack.

Edit: Also, I opened up the other servo postmortem, it looked like the electronics got really hot, some of the wire was melted against the chips.

Edit2: Okay, I think i might have found a clue, the arduino website mentions:
Quote
Note servos draw considerable power, so if you need to drive more than one or two, you'll probably need to power them from a separate supply (i.e. not the +5V pin on your Arduino). Be sure to connect the grounds of the Arduino and external power supply together.

I did not connect the external power supplys negative lead to the arduinos ground...but I don't really understand why this is necessary.
Title: Re: Beginner - Smoking servo
Post by: SmAsH on March 14, 2010, 02:20:18 PM
Well, if two circuits are connected at any point (the servo) its good practice to have common grounds, especially if you have a separate battery.
Title: Re: Beginner - Smoking servo
Post by: Soeren on March 16, 2010, 05:03:47 PM
Hi,


I did not connect the external power supplys negative lead to the arduinos ground...but I don't really understand why this is necessary.
Because electrons need a return path. They're nasty little critters and you gotta keep them unde control, or they'll misbehave.
If you just connect one side of a battery to a lamp, it won't light either.

Just be glad that learning this didn't cost you the µcontroller, which it could easily have.
Title: Re: Beginner - Smoking servo
Post by: cyberfish on March 16, 2010, 07:27:39 PM
But it still shouldn't blow up. It should just not work.

Actually, does any one know if the grounds really need to be connected?

Maybe the coupling within the servo is only mechanical (a relay or something)?
Title: Re: Beginner - Smoking servo
Post by: chelmi on March 16, 2010, 08:11:45 PM
Actually, does any one know if the grounds really need to be connected?

YES. but feel free not to trust us
Title: Re: Beginner - Smoking servo
Post by: cyberfish on March 16, 2010, 08:32:50 PM
Ah right, I forgot there's no digital ground.
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 24, 2010, 06:14:04 PM
I'm sorry for the necromancy, but I still have a few more questions and/or clarifications.

First of all, I didn't just hook up one side of the battery, I never said that. I said I didn't hook it up to the arduino ground; I hooked it up to the servos black(grd) lead. It was my understanding from chemistry that the electrons joined combined with the other metal in the battery, and that the chemical reaction is what drove the electrons down the wire(at least in photovoltaic cells). I am pretty rookie but i'm not totally a greenback, I have taken digital logic, microP, etc. So why then do I need to ground the battery? I still don't understand, and I don't want to blow another servo. Thank you very much for your time and patience.
Title: Re: Beginner - Smoking servo
Post by: chelmi on March 24, 2010, 06:31:07 PM
I'm sorry for the necromancy, but I still have a few more questions and/or clarifications.

First of all, I didn't just hook up one side of the battery, I never said that. I said I didn't hook it up to the arduino ground; I hooked it up to the servos black(grd) lead. It was my understanding from chemistry that the electrons joined combined with the other metal in the battery, and that the chemical reaction is what drove the electrons down the wire(at least in photovoltaic cells). I am pretty rookie but i'm not totally a greenback, I have taken digital logic, microP, etc. So why then do I need to ground the battery? I still don't understand, and I don't want to blow another servo. Thank you very much for your time and patience.

You have two "domains" in your system: the "unregulated domain" powering the servo, connected directly to the battery. And you have the "regulated domain" with the arduino AND the servo controller. You need a common ground for this part. The servo uses a common ground for the power and control, so the servo ground needs to be connected to the arduino. How is the arduino powered by the way?

Chelmi.
Title: Re: Beginner - Smoking servo
Post by: Soeren on March 24, 2010, 06:31:38 PM
Hi,

I'm sorry for the necromancy, but I still have a few more questions and/or clarifications.

First of all, I didn't just hook up one side of the battery, I never said that. I said I didn't hook it up to the arduino ground;
I know, I just made an allegory including only one circuit, but the principles are the same - to get a current flowing you need a return path.
Another allegory would be that you connect the positive poles of a 9V battery and a 1.5V battery. As long as you don't connect the negative poles of the batteries, nothing will happen - no matter how many courses in digital, processors and what not you have taken, no current flows (which at least one of the courses should have told you.

Apart from that, this is NOT what made your servo commit seppuko. Either it's jammed or faulty from the manu. did you open it to have a look?
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 24, 2010, 06:49:57 PM
Wouldn't the "return path" be the negative lead of the battery? The current from the positive end of the battery, through the servo, and returns to the battery on the negative end where it combines with some metal ion in the battery. Isn't that where the electrons go(but in the opposite direction)?

Also, I did open it up, the wires were melted together and to the circuit board, but the gears were fine.

Thanks again
Title: Re: Beginner - Smoking servo
Post by: cyberfish on March 24, 2010, 06:53:23 PM
Voltage is the potential energy per unit charge.

As we all know, there is no universal point where there is 0 potential energy. When we talk about energy, it's all relative.

In terms of gravitational potential energy, for example, can you tell me my altitude if I just tell you I have 10J of gravitational potential energy? No, because that depends on my reference - 10J more potential energy compared to where?

In physics we "define" 0 to be at infinity. Here we define it to be the negative terminal of the battery. The positive terminal is 9V more positive than the negative terminal. That's all the "9V" rating tells you.

1 unit charge at the positive terminal have, 9J higher potential energy than those at the negative terminal.

Your servo has 3 lines - 0V, 5V, and 6V.

You connected the ground of 5V supply to 0V, and 5V to 5V. All is good. The 5V line is 5V higher than the ground line, and that's all the servo cares about.

Now, you are adding in another battery, and connecting the positive terminal to 6V. 6V compared to what? The servo 6V line will be 6V higher than the negative terminal of the second battery. That doesn't tell you anything. It can be at any voltage. It can be 1000V, while the negative terminal of the battery is at 994V (compared to the ground of the first battery). Or -1000V and -1006V. The second battery doesn't care. It's maintaining the 6V difference.

In practice, since no current can flow, it will be as if it's not connected at all. The positive terminal of the 6V battery will take whatever voltage the "6V line" happens to be at, and the negative terminal will be 6V below that.

How do you make sure it's 6V above the ground of the first battery? You connect the 2 grounds.
Title: Re: Beginner - Smoking servo
Post by: Soeren on March 24, 2010, 07:21:24 PM
Hi,

Wouldn't the "return path" be the negative lead of the battery?
Yes exactly. the negative lead of the same supply. But how should the other side know what's going on?
What goes out of the positive side of a supply must go in, in exactly the same amount, at the negative side of the same supply (or the other way around, if we talk about the flow of electrons).
No electrons escape their destiny  8)

Birds sitting on electric wires doesn't get electrocuted since they only touch one wire. two circuits with only one connection don't "talk" for the same reason.

I'm running out of allegories here, so If you don't get it, either take my word that it is indeed so, or write it off as Black Art(TM)  ;D


Also, I did open it up, the wires were melted together and to the circuit board, but the gears were fine.
There probably was a short circuit, or one of the components have been dud, so either you take it back or welcome the opportunity to experiment with alternative circuits - all depending on price, your financial situation and your sense for "adventure".
Title: Re: Beginner - Smoking servo
Post by: petrarch on March 24, 2010, 07:33:43 PM
Voltage is the potential energy per unit charge.

As we all know, there is no universal point where there is 0 potential energy. When we talk about energy, it's all relative.

In terms of gravitational potential energy, for example, can you tell me my altitude if I just tell you I have 10J of gravitational potential energy? No, because that depends on my reference - 10J more potential energy compared to where?

In physics we "define" 0 to be at infinity. Here we define it to be the negative terminal of the battery. The positive terminal is 9V more positive than the negative terminal. That's all the "9V" rating tells you.

1 unit charge at the positive terminal have, 9J higher potential energy than those at the negative terminal.

Your servo has 3 lines - 0V, 5V, and 6V.

You connected the ground of 5V supply to 0V, and 5V to 5V. All is good. The 5V line is 5V higher than the ground line, and that's all the servo cares about.

Now, you are adding in another battery, and connecting the positive terminal to 6V. 6V compared to what? The servo 6V line will be 6V higher than the negative terminal of the second battery. That doesn't tell you anything. It can be at any voltage. It can be 1000V, while the negative terminal of the battery is at 994V (compared to the ground of the first battery). Or -1000V and -1006V. The second battery doesn't care. It's maintaining the 6V difference.

In practice, since no current can flow, it will be as if it's not connected at all. The positive terminal of the 6V battery will take whatever voltage the "6V line" happens to be at, and the negative terminal will be 6V below that.

How do you make sure it's 6V above the ground of the first battery? You connect the 2 grounds.

Thank you cyberfish, I wasn't thinking clearly. I was wondering where the control voltage went but now I realize it needs to be connected to the ground. I forgot the control line was 6V and not 5V, and I thought there was some sort of sink where the control voltage was also pulled to ground by the battery--probably because I'm used to working on a breadboard where you just run everything to the ground line or ground pin and call it done, but I realize that the negative lead of a battery is not analogous to a ground pin.  Thanks so much!