Shop OBEX P1 Docs P2 Docs Learn Events
Servos pulsing — Parallax Forums

Servos pulsing

jsandagerjsandager Posts: 2
edited 2008-05-13 14:29 in BASIC Stamp
I have created a pan and tilt mechanism using two servos (one pan, other tilt) to control a video camera on a UAV.·The remote system uses the·Parallax transmitter and receiver to send the signal and operate the servos. At the transmitter stamp·a joystick with two 5k potentiometers is used to control the pan and tilt·motion of the servos. I am using two HiTec HS-85MG servos and have found neutral positions for 0, 90, and 180° points.

My problem is that when I operate the servos not matter what·PAUSE length I use·they are pulsing like a·stepping·motor going through the range of motion at predetermined increments.

I have attached the program code I am using.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sandman[url=C:\Documents and Settings\Joel_\My Documents\My Pictures\Silicon Bowl\011231095843_57.jpg][/url]

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-13 14:16
    Your problem is that the time between servo pulses is much too long. The purpose of the PAUSE is to delay the PULSOUT so that the program produces a servo pulse about every 20ms. In your case, you've got a SERIN and several DEBUG statements in the loop, all of which take a very long time. The servo, when it doesn't see a control pulse within 20ms or so, shuts down until the next one comes along.

    The easiest solution would be to use a Parallax ServoPAL which is a simple co-processor that can be easily controlled to put out servo control pulses for one or two servos while not requiring attention until the servo's position has to change. See the documentation for the ServoPAL for details.
  • jsandagerjsandager Posts: 2
    edited 2008-05-13 14:29
    Thank you Mike.

    I purchased a ServoPAL, but did not hook it up because I thought it would send the same PULSOUT to each servo.

    Thank you,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sandman[url=C:\Documents and Settings\Joel_\My Documents\My Pictures\Silicon Bowl\011231095843_57.jpg][/url]
Sign In or Register to comment.