powering down servos
Paul Voss
Posts: 13
I am using the Basic Stamp homework board in an introductory engineering class that I teach.·My students need to be able to shut down servos to achieve a low-power mode·for a stamp-based design project. I thought that·they could use n-type mosfets to do this - essentially turn on the servo, move it, and then turn it off again. Unfortunately,·the small voltage·drop across the mosfet - or possibly another interference - destroys the clean square pulses·on the servo control pin. A scope shows the square wave becomes a fast exponential decay folowed by a second·peak a couple milliseconds later. Any ideas on what causes this and how to fix it would be most appreciated. Due to time constraints, I would like to make the n-type mosfets work if at all possible. Given that the idle current on a servo is almost twice the current used by the stamp, it seems that others must have tried to solve this problem before. I could not find any posts on this site or information on google addressing this question.
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Paul
Tie the ground lead of the servo to the collector of a 2N2222A or equivalent.· Ground the emitter.· Tie the base to a Stamp pin via a 1K resistor.· When you take the Stamp pin high, the servo will be grounded and should run normally.· If you take the Stamp pin low, the transistor will be cut off and there will be no current flow thru the servo.· The only current you would have would be the leakage current of the transistor.
Let me know how that works.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Newzed's idea will work fine if you want to use transistors but you said you have n- mosfets, but you can use them the same way Newzed recomended just the stamp pin via 1k resistor to the Gate of the mosfet then Source of the mosfet to ground then Drain to the ground input of the servo. But when you cut the power to the servo Gnd the servo will not hold into position, that is why it pulls a little current when it is at idle it is trying to maintain its position. One more thing turn off the power to the servo mosfet before you stop sending the Pulse to the position input to keep it from jerking out of position.
Hope this helps let us know.
Also you could use a small PCB relay to kill the power to the servo..just an after thought
A couple things come to mind:
1. Is your gate voltage high enough when you're turning the servo "on"? Some MOSFETS require a high gate voltage to turn on all the way. So-called "logic" MOSFETs should saturate with 5V on their gates, however.
2. You might consider changing to a P-channel device to switch the servo's high side. The reason I suggest this is that if you remove the ground and keep the signal line low (the normal inactive state), the servo might still be drawing power through the input through any input-protection diodes that might exist internally, thus negating any power savings.
-Phil
-Phil
Saturation When VGS > Vth and VDS > VGS − Vth The switch is turned on, and a channel has been created, which allows current to flow between the drain and source. Since the drain voltage is higher than the gate voltage, a portion of the channel is turned off. The onset of this region is also known as pinch-off. The drain current is now relatively independent of the drain voltage (in a first-order approximation) and the current is controlled by only the gate–source voltage, modeled as:
with say a IRF510 with a Vgs of +/-20 and a Vth of 2-4 v then I think 5 would would be fine for just a switch on and off on the servo Gnd, but if you was switching at a faster rate say 20k and above I would use more around 10v at the gate..
But, yes, you're right in that a person could probably use a device like the IRF510 (which is rated for 4A+ with a VGS of 10V) to drive a 1A load from logic levels. And the voltage drop would probably not be significant. My choice, though, would be a device that better matches the task at hand and, possibly, uses a smaller package. And to switch the servo power (the topic of this thread), I'd still prefer a P-channel device (assuming the servo was being powered by +5V also).
-Phil
1) connect an n-type mosfet (I'm using the parallax bs170) between the servo and ground
2) connect the servo + to the regulated 5V supply (Vdd, not Vin)
3) place 1000 uF capacitor across the servo power (servo power and servo ground - not actual ground)
4) turn the mosfet on using an i/o pin
5) set the pulsout i/o pin low
6) drive the servo to a new position using the pulsout command
7) turn the mosfet off using the i/o pin
8) set the pulsout i/o pin high (otherwise it will drain current from the +5V supply)
After completing steps 1-8, the servo will have moved and be in an idle state. The total current draw will be only the ~7 mA for the Basic Stamp. A slighly more robust solution uses the 10k potentiometer as a voltage divider to boost the pulsout signal a few tenths of a volt. This way the pulsout ground is closer to the servo ground (which is a few tenths of a volt above real ground due to the mosfet). Driving the servo from the 5V supply isn't perfect - the large current draw drops the supply by a volt or two when the servo moves against a load. This can be tolerated (thousands of servo cycles overnight with LEDs running as well did not seem to dammage anything) or fixed (placing the 2200 uF cap across the 5V supply helps a lot. So does driving the servo in smaller steps (software fix). Finally, power and drive only one servo at a time. Hope this is useful. Thanks for all the help.
Paul