servo motor resets 16f877a


Closed Thread
Results 1 to 40 of 86

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    Hi Acetronics,
    I think you are wrong because my signal is 50hz.I am using 20ms periodic pulses,if t=100 then 1ms high and 19ms low.if the period 20ms then frequency will be 50hz from the formula f=(1/T)
    here is my signal code

    PULSOUT PORTC.2,T
    PAUSEUS 20000-(T*10)

    where am I wrong?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by burak450 View Post
    Hi Acetronics,
    I think you are wrong because my signal is 50hz.I am using 20ms periodic pulses,if t=100 then 1ms high and 19ms low.if the period 20ms then frequency will be 50hz from the formula f=(1/T)
    here is my signal code

    PULSOUT PORTC.2,T
    PAUSEUS 20000-(T*10)

    where am I wrong?
    Look at the loop in your code.
    Aboslutely no 'bounds' checking.
    What if...T = 0? Then pauseus = 20000, ok no problem...
    What if T=2000? Then pauseus = 0, ok not much of a problem...
    What if T=2001? Then pauseus = 65526, ok, shouldn't happen because you've got T defined as a BYTE

    But...what happens when you try to drive the servo out of it's physical limits?
    What happens to the current draw if you hold a servo that's trying to move? Hook up an ammeter and find out real quick. And if you don't have an ammeter, hook up a voltmeter to your 'battery' and try it and see what happens to your voltage...

  3. #3
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    I think this part what you said....

    Quote Originally Posted by skimask View Post
    Look at the loop in your code.
    Aboslutely no 'bounds' checking.
    What if...T = 0? Then pauseus = 20000, ok no problem...
    What if T=2000? Then pauseus = 0, ok not much of a problem...
    What if T=2001? Then pauseus = 65526, ok, shouldn't happen because you've got T defined as a BYTE

    But...what happens when you try to drive the servo out of it's physical limits?
    What happens to the current draw if you hold a servo that's trying to move? Hook up an ammeter and find out real quick. And if you don't have an ammeter, hook up a voltmeter to your 'battery' and try it and see what happens to your voltage...

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by burak450 View Post
    Hi Acetronics,
    I think you are wrong because my signal is 50hz.
    ?

    Lol ...

    It has been verifyed with a R/C Pulsemeter.

    Checks pulse AND repeating frequency ...

    Y've done the mods to have your program running ...

    Runs awfully bad for a tracker, but runs ... on the USB supply from my PC. ( 500 mA ! )

    YOU are wrong in your calculations ... that's it !!!
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    Hi Acetronics,
    First of all,calm down

    I just said my idea...

    I havent got R/C Pulsemeter,I cant measure the pulses...

    Probably your calculations are right.I am here because my project doesnt work correctly and want to have second opinion.

    Can you give me the right code ?

    will only changing variable type byte to word be enough????

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by burak450 View Post
    Can you give me the right code ?


    will only changing variable type byte to word be enough????
    Probably not...
    Think about this...
    How long does it take for ADCIN to execute?
    How long does it take for LCDOUT to execute?
    And fix your power supply...

  7. #7
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default


    And fix your power supply...

    as you said that you mean same ground but another power supply...

    did I understand right?

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by burak450 View Post
    as you said that you mean same ground but another power supply...

    did I understand right?
    No I mean read back thru the thread! I don't see any mention of adding any capacitors anywhere in the circuit...except where somebody but you has mentioned them...
    And, you say you are using a switching adapter, like a wall-wart rated at [email protected]?
    How long is the cord feeding the PIC/servos? How much 'noise' is getting to your PIC? How much 'noise' does your servo generate under a load? Any capacitors in there anywhere?
    http://en.wikipedia.org/wiki/Decoupling_capacitor

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Burak

    Don't worry for me ... I always am calm.

    I Exceptionnaly cook code for others ...


    so,

    - you'll fist check "T" calculations and do not allow it to go out of the 800 - 2200 µs range

    - Check for a "decent" increment to the same "T" variable

    - Understand that 50 Hz is not a MUST ... just be in the 35-50 Hz range; doesn't need to be a constant frequ. nor.


    PS: "Give me THE code" or "Give me THE scheme" are the sentences that suddently re activate my Altzheimer ...

    What Were we talking about ??? ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Smile

    Ok.I wont want you to give code because i know Altzheimer is very tough disease

    I am gonna try what you said.If I fail I will disturb you again

    Thanks for help up to now....

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Why not just write simple code to sweep servo left to right and back right to left for testing? BTW, if you use a 5v regulator with 5v output power supply, it will cause a power drop when you try to draw current. A voltage reg will probably need 6.5v++ input voltage. Also, I have driven 4 large servos off of 2 paralleled voltage regs and a low current reg for the pic....no problems at all.

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Burak

    We haven't solved the power problem ...

    so, I ask the question once more : Which is your testboard ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  13. #13
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Unhappy

    A voltage reg will probably need 6.5v++ input voltage. Also, I have driven 4 large servos off of 2 paralleled voltage regs and a low current reg for the pic....no problems at all.
    A low current reg?

    He said we used large servos and mine is not large but I have to ask it because after a hour i will go to buy (9v supply,7805..,)

    Should I buy a current regulator?

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