Shop OBEX P1 Docs P2 Docs Learn Events
powering down servos — Parallax Forums

powering down servos

Paul VossPaul Voss Posts: 13
edited 2006-12-11 00:23 in BASIC Stamp
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

  • NewzedNewzed Posts: 2,503
    edited 2006-12-09 00:21
    Paul, are you figuring the idle current at about 8 or 9 ma?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Paul VossPaul Voss Posts: 13
    edited 2006-12-09 00:27
    Sid, Thanks for your reply. The Basic Stamp seems to draw ~8 mA. The Parallax servo draws about twice this amount (when it is not receiving pulses from the Stamp).

    Paul
  • NewzedNewzed Posts: 2,503
    edited 2006-12-09 00:32
    Paul, you could try this:

    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
    ·
  • bennettdanbennettdan Posts: 614
    edited 2006-12-09 05:30
    Paul

    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
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-12-09 05:36
    Paul,

    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
  • bennettdanbennettdan Posts: 614
    edited 2006-12-09 06:28
    Most N-mosfets turn on with 5v to the gate from the stamp just fine due to the saturatiion being higher that Gnd.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-12-09 07:28
    Sorry to disagree, but most garden-variety N-channel MOSFETs require more than 5V on the gate to turn on fully. One has to be careful to select "logic" MOSFETs with a low VGS threshold to be sure that they'll perform as desired with logic-level inputs. Even then, it's best to check the transfer characteristics curve for the current levels you plan to switch.

    -Phil
  • bennettdanbennettdan Posts: 614
    edited 2006-12-09 11:31
    if you use this ...

    Saturation When VGS > Vth and VDS > VGSVth 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..
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-12-09 19:05
    Here's a graph of the static transfer characteristics for the Philips PMV45EN "logic" N-channel MOSFET. At 25°C, VGS threshold for this device is typically 1.5V. But this is where the device begins to conduct. "Full" conduction (i.e. significant current flow) isn't obtained until VGS reaches 2.5V or more. This is why it's always important to consult the transfer characteristics curve, instead of relying only on the threshold voltage. A MOSFET with a 4V threshold voltage may or may not conduct adequate current with 5V on 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
    390 x 407 - 8K
  • Paul VossPaul Voss Posts: 13
    edited 2006-12-10 15:43
    Thanks everyone for your reponse to my question about a low-power mode for servos. Based on the advice and a lot of experimentation, I was able to find a solution. Here it is:

    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
  • bennettdanbennettdan Posts: 614
    edited 2006-12-11 00:23
    Sounds good Paul so the N mosfet worked switching the low side of the servo... good glad you could get it going.
Sign In or Register to comment.