More Servo Woes


Results 1 to 11 of 11

Thread: More Servo Woes

Threaded View

  1. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Chris,
    I have only a little experience with servos, and do not have my computer at hand, but the best I remember, if I sent a number to my servo it executed fully before accepting a new value, so I am thinking if you send a count to the servo something like 1500, 1510, 1520 . . . to cause movement you can snuggle an interrupt between the numbers.
    EDIT: after reading your code, looks like pretty much what you are doing. I'm empty.
    Quote Originally Posted by chrisshortys View Post

    Now the problem I am having is the FOR loop doesnt seem to be interuptable. So the servo will only respond to a new input once it has reached its current destination. I want to find a way to have the servo change direction before it reaches its end destination.
    I see no interrupt in your code, Why would you be able to stop it? I never have been able to hijack the count variable in a for next loop, you might try using an interrupt routine and clearing the variable in there, I do not know if it will work though.

    The second issue i have is the programe seems to freeze at times. The LCD does not update and the programe does not recognise any change in input for a while before suddenly snapping back into life.
    Could be latency, could be Breadboard issues where stray capacitance stops the oscillator, could be power supply causing PIC brownout reset, I see no config statement so I assume you are using default config, . . . could be GOTO MAIN at the end of servomove when you used gosub to get there, causing a stack overflow, and eventual reset. . . . On closer inspection looks like you have a return and goto main in there . . . I don't know how that would affect operation if at all since theoretically the code should never go past the return, but who knows? Computers (and PICs) are stupid, but not sloppy, they only do what you tell them to do, whether intentionally or not.
    Keep us posted, I would like to see your Final Cut, looks like it would make a cool VR control for a camera in an RC heli.
    Last edited by Archangel; - 27th February 2009 at 19:36.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Problem with 12F629, servo and EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 1st March 2008, 09:53
  2. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  3. Beginner + Servo
    By james in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2007, 21:31
  4. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 18:15
  5. Servo control woes
    By Eriswerks in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 28th February 2006, 00:12

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