Weird servo response. - Page 1
Forum section: electronics / beginners

author: mindentropy
author_rank: Contributor
timestamp: November 30, 2013, 07:49:06 pm
content: 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 thishttp://hobby2go.com/products/acessories/others/4aa-battery-holder-detailI 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?

author: BeerCannon
author_rank: Contributor
timestamp: November 30, 2013, 08:59:31 pm
content: 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.

author: Zbig
author_rank: Frequent Contributor
timestamp: November 30, 2013, 09:39:50 pm
content: It sounds like you could be using an open-collector output driver without a pull-up resistor.

author: mindentropy
author_rank: Contributor
timestamp: December 01, 2013, 05:13:57 am
content: @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 picsMSP430 launchpad + servo on a breadboard.Closeup of the battery pack.Breadboard + battery pack.PWM signal waveform.PWM Waveform.

author: JoeO
author_rank: Frequent Contributor
timestamp: December 01, 2013, 05:50:48 am
content: I think you are missing the ground connection between the protoboard/servo and the MSP430 board.

author: Zbig
author_rank: Frequent Contributor
timestamp: December 01, 2013, 09:13:32 am
content: 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

author: BeerCannon
author_rank: Contributor
timestamp: December 02, 2013, 03:45:51 am
content: 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).

author: mindentropy
author_rank: Contributor
timestamp: December 02, 2013, 05:30:54 am
content: @JoeO, @BeerCannon, @ ZbigI 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?

author: BeerCannon
author_rank: Contributor
timestamp: December 02, 2013, 12:51:56 pm
content: 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?

author: mindentropy
author_rank: Contributor
timestamp: December 03, 2013, 06:40:36 am
content: 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.

author: BeerCannon
author_rank: Contributor
timestamp: December 03, 2013, 01:02:45 pm
content: Quote from: mindentropy on December 03, 2013, 06:40:36 amI 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).