Shop OBEX P1 Docs P2 Docs Learn Events
Servo moving too slowly with BS2 — Parallax Forums

Servo moving too slowly with BS2

XypherXypher Posts: 10
edited 2009-09-22 18:19 in BASIC Stamp
Hey guys, I am using a Hitec HS-55 micro servo with my BS2. it is powered by the 5v regulated supply from the bs2 itself. plugged into a 9v battery. when i run a simple program such as this:

counter VAR Word
DEBUG "Counterclockwise 10 o'clock", CR

FOR counter = 1 TO 150
PULSOUT 0, 1200
PAUSE 20
NEXT
END

The motor takes about 5seconds/longer to reach this position. it moves in steps of 10-15 degrees at a time. However when i use the same servo in my r/c plane, it moves instantly and smoothly.

What could be causing this? I tried powering the servo with the 9v battery and it is faster, but not nearly as fast as how it SHOULD actually work. Its not a servo malfunction as I have 3 and all work in this weird manner.

Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-22 16:11
    The problem is that your power supply is inadequate.

    The servo is drawing much more than the Stamp's regulator can supply and the regulator shuts down to protect itself. This causes the Stamp to reset and restart the program once the regulator (and battery) recovers. The servo starts moving to its designated position (with a 2.4ms control pulse ... to one end of its range) and the whole process starts over again.

    By the way, a 9V power supply to the servo will eventually damage it. They're designed to run off a 4.5V to 7.2V supply.
  • XypherXypher Posts: 10
    edited 2009-09-22 16:16
    a video to illustrate my problem.

    Thanks for the quick reply Mike! Even before the video was done uploading! [noparse]:)[/noparse]

    According to one of the pdf's by Parallax, their servo connected directly to the 5v supply. I followed the pdf and thought i would be fine by doing so.

    How do i get a 4.5-7.2v supply without adding too much bulk and weight to my circuit? It is supposed to be a handheld device.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-22 16:43
    You didn't say what your power source was. Remember that 9V batteries have very low capacity and high internal resistance. They're a very poor choice for a power source for any kind of motor. Most of the extra voltage gets dissipated as heat in the regulator anyway.

    Probably your best choice would be a 4 cell AA or AAA battery pack. With 4 alkaline cells, you'd get 6V to power the servos directly and 6V for the input to the Stamp's regulator. If you decide to use a rechargable battery pack, use 5 x AA or 5 x AAA NiMH cells to provide 6V.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-09-22 17:20
    I believe Mike is right about the low battery issue…a 9V battery won’t power a servo for very long due to current demand, however, what struck me funny about your message was that you mentioned the servo always moving toward a specific position, yet the code you posted should just set the servo to a fixed position and not move it at all. You’re telling a servo connected to P0 to go to position 1200 (2.4 mS), which may hammer it against the mechanical stop as well, which could also cause a reset/brownout.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • XypherXypher Posts: 10
    edited 2009-09-22 18:19
    i had previously set it to 0.6ms. so it takes a long time to turn 180 degrees. thanks for your help. I will try using a 4xAA tomorrow. (its 2.20am here, time for bed).
Sign In or Register to comment.