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

    Bruce thanks for advice,i tried million times but couldnt connect separate supply correctly.I think you mean opto-isolotor circuit.Do you suggest any opto-isolator circuit??
    Some guys said i dont need this circuit.I am confused now.

    Acetronics,I took 5v supply to servo from same source where I took power to pic.I mean servo and pic is feed same source...

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Monitor the PCON register

    Hi,

    16F877a has got a Power Control Register (PCON). Section 14.10 page 151 in the datasheet.

    In the top of your code just after you initialize the LCD. Read the PCON into some variable and display it on the LCD for say 5 seconds. Note it down just after a reset. This may help decide the cause of the reset---> Brown Out, WDT, MCLR etc.

    Also make sure that your RB3 (Pin 37) is not floating. It is the LVP pin and noise on that can trigger the ICSP mode.

    Just for information on the opto part you can use a TLP250 optocoupler (works upto a few khz) which has got a totem-pole output. So you drive the LED and get a 0-1 on the output. I use it mainly for my IGBT driver needs.
    Last edited by sougata; - 1st October 2008 at 16:08. Reason: Mentioned the opto
    Regards

    Sougata

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You should not need an opto, but you may want to include the series resistor shown in the .PDF Alain linked to.

    A separate power supply for the servo is a good idea, but you need a common ground connection between the two power supplies.

    Most hobby type servos will work fine with a DC supply of ~4.8 to 6Vdc. I normally use a set of 4 x D cells. Just connect the ground leg from your batteries to the ground leg of your regulated supply for the controller.

    If you use another regulated supply for the servo, make sure it can handle the servo load current. A servo can draw quite a load. Some up to 1A or more. Having this load on your primary supply can drop voltage and cause a device reset. With separate supplies you shouldn't have this problem.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Ok, Folks

    I've got it ...

    Servo driving values on C.2 go out of the nominal 0.8 - 2.2 ms range OR Pause between pulses goes wrong.

    Servo bumps on its mechanical stops ... or the amp doesnt like the pause !!!

    That's all !

    Alain
    Last edited by Acetronics2; - 1st October 2008 at 16:10.
    ************************************************** ***********************
    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

    Acetronics,
    Can you explain it more clear,i dont get what you mean.Is there any solution on your mind?

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Burak

    The only solution is for you to verify you send correct signals to your servo ...

    800 to 2200 µs @ 35 - 50 Hz ... only allowed.

    Nothing more or less to say !

    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 " !!!
    *****************************************

  7. #7
    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?

  8. #8
    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...

  9. #9
    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...

  10. #10
    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 " !!!
    *****************************************

  11. #11
    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????

Similar Threads

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