Author Topic: Weird servo response.  (Read 4832 times)

0 Members and 1 Guest are viewing this topic.

Offline mindentropyTopic starter

  • Contributor
  • Posts: 32
Weird servo response.
« on: November 30, 2013, 07:49:06 pm »
Hi,
  I am powering a GWS S03NF servo with 4 x 1.2V AA (700mAh) batteries. I have hooked the signal line to a MSP430 launchpad. The batteries are sitting on a battery holder similar to this http://hobby2go.com/products/acessories/others/4aa-battery-holder-detail   I am sending the right PWM signal(50 Hz with 1.8ms pulse width).
  The problem is that the servo only responds or moves when I touch the contacts of the battery holder. If I gently touch the contact with a plastic it does not respond. What seems to the problem? Are the batteries able to provide enough discharge currents?
 

Offline BeerCannon

  • Contributor
  • Posts: 45
  • Country: us
Re: Weird servo response.
« Reply #1 on: November 30, 2013, 08:59:31 pm »
What are you using to send the PWM signal?  An Arduino?   A 555 oscillating circuit?   Is the ground from the PWM source connected to the ground of the servo battery pack?   Describe your circuit in more detail, and perhaps even attach a photo of it.  People will be able to offer much better help if you do.
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Weird servo response.
« Reply #2 on: November 30, 2013, 09:39:50 pm »
It sounds like you could be using an open-collector output driver without a pull-up resistor.
 

Offline mindentropyTopic starter

  • Contributor
  • Posts: 32
Re: Weird servo response.
« Reply #3 on: December 01, 2013, 05:13:57 am »
@BeerCannon,
   I am sending it using a MSP430 launchpad sending it at 3.3V.  The PWM source is connected to the USB ground. The servo is connected to the battery ground.

Some pics
MSP430 launchpad + servo on a breadboard.
Closeup of the battery pack.
Breadboard + battery pack.

PWM signal waveform.

PWM Waveform.
 

Offline JoeO

  • Frequent Contributor
  • **
  • Posts: 527
  • Country: us
  • I admit to being deplorable
Re: Weird servo response.
« Reply #4 on: December 01, 2013, 05:50:48 am »
I think you are missing the ground connection between the protoboard/servo and the MSP430 board.
« Last Edit: December 01, 2013, 05:54:58 am by JoeO »
The day Al Gore was born there were 7,000 polar bears on Earth.
Today, only 26,000 remain.
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Weird servo response.
« Reply #5 on: December 01, 2013, 09:13:32 am »
Heh, yeah, you cannot have the control signal just hanging there in free air with two separate power supplies and separate grounds like that. The PWM signal has to be in reference to something. What you're trying to do now is like trying to get "-" from one battery, "+" from another and expecting the bulb to light up ;)
 

Offline BeerCannon

  • Contributor
  • Posts: 45
  • Country: us
Re: Weird servo response.
« Reply #6 on: December 02, 2013, 03:45:51 am »
I agree that the ground on the LaunchPad board should be connected to the ground rail on your breadboard, along with the ground from the battery pack.

What is the red wire on the LaunchPad for? 

edit:  looks like a ground.. try connecting that to the breadboard!  (And maybe think of using a black wire for it instead of red, it helps you visually troubleshoot more easily!  I'd also use a different color for the signal line from the LaunchPad.  If you have more white like you used on the extension, use that.  Just my personal idiosyncrasy.  If I have enough wires of the right color and length, I always try to keep my grounds black, VCC red, and signal lines something funky like blue or yellow so they stand out.


Is the resistor on your PWM signal really necessary?  I would think the servo could easily handle 3.3V on the signal line.

I'm no expert, in fact I'm quite a n00b, but I've built a few 'bots with servos and never used a resistor on a signal line (even 5V signal lines).
« Last Edit: December 02, 2013, 04:03:53 am by BeerCannon »
 

Offline mindentropyTopic starter

  • Contributor
  • Posts: 32
Re: Weird servo response.
« Reply #7 on: December 02, 2013, 05:30:54 am »
@JoeO, @BeerCannon, @ Zbig
   
   I connected the ground of the MSP430 with the '-' to have a common ground just after I posted the pics. Things started working. :).  I thought of keeping the grounds isolated. I was worried that if the MSP430 launchpad would be able to handle high current through the ground.  I might have missed connecting the white signal line while taking the pics.

@BeerCannon,
   That resistor is a 'just in case' current limiting. Its not necessary. Just not in a mood to fry the pins at this time. Also I put a 1000uF cap in there if there is a sudden surge in current. I am not sure my batteries are able to discharge rapidly.

I am having a newbie doubt hope you guys can clarify.

1) What would happen if the ground of the launchpad is lower than the batteries or for that matter the ground reference of the power supply of the servo as I am connecting the micro controller GND and battery GND?
 
2) Is it possible to isolate power supplies of the servo and the microcontroller?

   
 

Offline BeerCannon

  • Contributor
  • Posts: 45
  • Country: us
Re: Weird servo response.
« Reply #8 on: December 02, 2013, 12:51:56 pm »
Glad the circuit is working for you.  If you connect all the grounds together, they're all theoretically at the same potential.  It is possible to accidentally create ground loops if you connect the grounds improperly.   The idea is to connect all the grounds to a single common point, don't connect one ground to another, to another, etc. in a daisy-chain fashion or you risk creating a ground loop.  Hopefully someone more qualified will explain this better if necessary.

You SHOULD be using two different power supplies for your microcontroller and servo (with their grounds connected).  They are most likely designed to operate at different voltages (5v or 3.3v for your microcontroller, and probably 4v to 6v for your servo).  If you try to run motors from an output pin of the micro, you could potentially attempt to draw more current than the micro can source, and it could damage the micro. 

Why are you thinking about isolating the two power supplies?
 

Offline mindentropyTopic starter

  • Contributor
  • Posts: 32
Re: Weird servo response.
« Reply #9 on: December 03, 2013, 06:40:36 am »
Isolation is if the servo pulls a high current then I would have a voltage drop for the micro. I had confused that different grounds meant isolation. AFAIK if I want complete isolation then I have to be using an optoisolator.
 

Offline BeerCannon

  • Contributor
  • Posts: 45
  • Country: us
Re: Weird servo response.
« Reply #10 on: December 03, 2013, 01:02:45 pm »
Isolation is if the servo pulls a high current then I would have a voltage drop for the micro. I had confused that different grounds meant isolation. AFAIK if I want complete isolation then I have to be using an optoisolator.

I think you'll be fine with non-isolated power sources, one for the servo and one for the micro.  They only have ground in common, and the electricity flows from each power source, through their respective loads, then into ground (according to 'conventional' flow, anyway).    You can test the servo current draw.. put an ammeter in series with it, run some code to move it around and see what it typically draws.  Then grab the horn and stop the motor when it's trying to move.  That should give you something close to a 'worst case' scenario.. ("stall current").   It's not the most scientific approach, but it's probably good enough for a hobby project.  Just don't overdo it and strip the gears if they're plastic.

If you have a normal servo, you'd probably need to send pulses to move it to one extreme, pause, then move to the other, then pause, and try to stall it while it traverses.  If you have a servo modified for continuous rotation, just send a pulse to turn it fully on in one direction or the other, and then try to stall it.  If your ammeter has a peak-detect/hold function, take advantage of it so that you read the max current draw that you were able to produce under stall conditions.

If you have multiple meters, simultaneously connect a voltmeter in parallel across the power terminals of the microcontroller.  This will show you very clearly whether or not the varying current draw of the servo (from it's own power supply) has any influence on the voltage seen by the microcontroller from it's power supply.  I doubt you'll see much influence.

Again, I'm far from an expert or engineer.. but I've built some servo+microcontroller gizmos with good results and never needed isolated power supplies (just separate ones).
« Last Edit: December 03, 2013, 01:25:22 pm by BeerCannon »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf