Servo strange occurances


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Posts
    13

    Default Servo strange occurances

    For some reason, I can't understand why my servo will only move to the position of the first servo position's loop and then ignore everything else. I tried both pulsout as well as HIGH/LOW loops. It will move to the first position just fine, then stop there. I thought my servo was bad, I plugged it into my Basic Stamp board and everything was fine. The servo runs off a separate power supply, so it can't be a power issue.

    It appears that it is not stuck in any loop or anything since I inserted an LED to blink in between changing of the servo positions, and the LED blinks properly. What gives??

    Here's my code if anybody can decipher and help me with this problem (both has the exact same problem, they both only move to the first position)

    P.S.
    I'm using a 16F876A with a 4mhz resonator, hence the pulsout numbers 200 and 100 for 2ms and 1ms respectively.

    =========HIGH/LOW version =============

    main:

    for x = 1 to 100
    high servo
    pause 2 '<----it only positions in this loop
    low servo
    pause 20
    next

    for x = 1 to 100
    high servo
    pause 1
    low servo
    pause 20
    next

    goto main



    ==========here's my pulsout version ============

    main:

    for x = 1 to 100
    pulsout portc.6, 200
    pause 20
    next


    for x = 1 to 100
    pulsout portc.6, 100
    pause 20
    next

    goto main

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Cool

    Make sure that the ground pin of pic is common with the servo's ground.

    Or post the schematic.
    ---------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3


    Did you find this post helpful? Yes | No

    Default servo-tude

    try shortening your pause between updates to 15mS and see if that helps.

    ----------------Picster---------------

  4. #4
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    I tried to shorten it like you said (and even tested it in the entire range of 10 to 25ms!)...no luck on that either, exact same response.

    The servo is grounded with the common ground of the entire circuit so it shouldn't be a problem.

    The strange thing is, if I go back and change the position of the first loop from 100 to be 200, it moves to that position only and then stops (and a bit of a sputter)...if I manually change the first loop from 200 to 100, it moves to that position and stops (and sputters as if it only moved slightly in the second loop and then back to the first loop, like never fully running the entire second loop)

    Why in the world would it do this? I am I missing ANYTHING in the code? The loops look proper, I've never had a problem like this using Basic Stamp, but I am new to PicBasic though. =X

  5. #5
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    here's the schematic

    <a href="http://img214.imageshack.us/my.php?image=picservo5ew.jpg" target="_blank"><img src="http://img214.imageshack.us/img214/7594/picservo5ew.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" /></a>



    Thanks guys for responding and helping me out, really appreciate the effort.

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    In your first post, you mentioned “The servo runs off a separate power supply, so it can't be a power issue.” However, your schematic contradicts this.

    It sounds like the servo might be pulling your power supply down enough to upset (continually reset) the 876A – this could be the cause of the sputter you describe as it "restarts" each time. Can you describe your power supply setup for us?

    You might want to try 1) increasing the size of the capacitors on both sides of the regulator and 2) adding some decoupling and bypass capacitors as close as possible to VDD and VSS on the 876A. Let us know ...

    Good Luck,

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  7. #7
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    YES it works! Thanks, paul borgmeier, for pointing the grounding misunderstanding out. I *assumed* that it was separate from the 5v out of the regulator and was being fed directly from the power, so it was considered "separate." Sorry if that confused everyone and made it more difficult to help me.

    I rewired a 9V battery to the servo instead so it appears that it WAS a power problem. I would rather use the power supply instead. Paul, you suggested some capacitors to the VSS VDD of the PIC, can you give me some cap numbers I should be using and how to wire them up?

    My current power setup is powered from a wall wart at 7v into a 7805 5v regulator with a 100uF on the V-in pin, and a 10uF on the V-out pin. Much like this http://www.tkk.fi/Misc/Electronics/circuits/psu_5v.gif


    Thanks everyone that helped.

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  2. Problem with 12F629, servo and EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 1st March 2008, 09:53
  3. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  4. Beginner + Servo
    By james in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2007, 21:31
  5. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 18:15

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts