Servo strange occurances


Closed Thread
Results 1 to 10 of 10
  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.

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


    Did you find this post helpful? Yes | No

    Smile

    For the 876A try a bypass of 0.1uF ceramic (C2) and a decoupler of 10uF electrolytic (C1) as close to as possible to the VDD and VSS pins as shown. Every design is different and it depends on trace/wire lengths, other components, and everything else that is going on. (These are the values I start with and use in almost all of my designs.)

    It is hard to say what to try with the power supply without knowing more about your wall wart and your servo. You mentioned 7V but nothing more. You could try adding one or more 100 – 470 uF capacitors in parallel with the capacitor on the “regulator” side of the regulator and even possibly a 100 uF on the other side.

    You should note that most wall warts supply the rated voltage (7 V in your case) at the rated amperage (you did not list). Further, they usually supply a higher than rated voltage if loaded less and a lower than rated voltage if loaded more. If your load is less, then you will not have a problem. However, ... most 7805 regulators have a Vdrop of 2.0V, meaning if your wall wart voltage drops below 7 V due to a larger than rated load, the regulator will drop out (i.e., “turn off”). This too could be adding to your troubles. Can you provide more information on your servo and/or on your supply? You also can try the above. Again, let us know.

    Good Luck,

    Paul Borgmeier
    Salt Lake City, Utah
    USA
    Attached Images Attached Images  

  9. #9
    Bill H's Avatar
    Bill H Guest


    Did you find this post helpful? Yes | No

    Default Low dropout regulator

    With 7 volts in, just as Paul said the headroom to the 7805 is limited.
    You could replace the 7805 with low dropout regulator such as an LM2937(5v). It's a pin for pin replacement.
    Your headroom increases from ov to 1.5v in your example.
    Bill H

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    as far as i'm aware of.. those wall-wart transformer are really not accurate as we can wish. 7Volt can also be 10-15 volt. BUT measure it with a scope to see what's happen when you load it with your PIC stuff. LOOK what the voltage looks like before going to your voltage regulator? A bigger capacitor at the input Help?

    You can be surprise... a LDO is a good option btw.

    Or choosing another Wall-wart voltage 9Volt and up
    Last edited by mister_e; - 23rd March 2006 at 15:39.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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 : 1

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