servo motor resets 16f877a


Closed Thread
Results 1 to 40 of 86

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, Burak

    THIS could be a geat help :

    http://www.parallax.com/Portals/0/Do...ic/Signals.pdf

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

  2. #2
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    I am trying to design an object tracker (only left and right) and I am using phototransistors by using two analog inputs.I have to explain my problem more clear.When I turn power on servo tracks object but after a while sometimes pic resets itself or servo motor suddenly stops.I hope
    I explained it clearly.What do you suggest? Here is my design.When you see the design there is a lcd.I use it for watching the values of analog input.When servo rotates,brightness of lcd changes (getting brighter or darker)...I think thats another weird thing...
    Last edited by burak450; - 1st October 2008 at 01:17.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by burak450 View Post
    When servo rotates,brightness of lcd changes (getting brighter or darker)...I think thats another weird thing...
    Doesn't that right there tell you something about the quality of your power supply?
    Let's see...if I'm driving down the road, and my headlights change brightness, does that tell me anything about the electrical power in the car? If I'm sitting in my living room at night reading a book and the room's lights either dim or get brighter, would that tell me something about the local power grid?

    I don't see ANY capacitors in there, either across Vdd and Vss or across your servo's power supply. I don't see what kind of power you are supplying this circuit with. I don't see a lot of anything.

    Ya know, for that matter, we haven't seen your code yet... Who knows...maybe it is actually a firmware problem...

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


    Did you find this post helpful? Yes | No

    Thumbs up

    I would agree with Skimask re: the capacitors and your power supply, I would add, disable Brown Out Reset in your config statement so PIC does not reset, I would further suggest you change your reference to God Blessed servo, just remembering something Moses said to Pharoe, "by your own words . . ." Cause if he Damns it, it's toast.
    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.

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Hi, Burak from your schematic and your explanation I understand that is just a power supply problem! Add 10nF capacitor to the Vdd pic pin. Since surely you are using battery, my suggestion is that you use a two 9 volts batteries in parallel to a 7805 and use its output as power supply for your project. One way to check quickly that current failure is your problem, can be achieved simply removing (disconnect it) the backligth of your lcd, and very likely the problem will disappear as long as the present battery will be able to supply the required energy

  6. #6
    Join Date
    Sep 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    i should repeat that=Lcd brightness doesnt change at normal work. when servo moves than it goes high or low...
    my power supply is that.

    switching adapter
    input:ac 100-240V-50hz 0.36A
    output:dc 5v--2.5A

    and my program is that

    Code:
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 5
    DEFINE LCD_BITS  4
    DEFINE LCD_LINES 2
    DEFINE OSC 4                                                                       
    DEFINE ADC_BITS     8      
    DEFINE ADC_CLOCK  3     
    DEFINE ADC_SAMPLEUS 100
    SYMBOL F=PORTA.0
    SYMBOL G=PORTA.1
    alta var byte
    usta var byte
    altb var byte
    ustb var byte
    ADCON1=2
    TRISA=3
    TRISB=0
    PORTB=0
    TRISC=0
    LCDOUT $FE,1 
    pause 4000
    adcin  0,ALTa
    ADCin  1,usta
    
    t var byte
    i var byte
    T=150
    
    yap:
    
    
    
    
    adcin  0,altb
    ADCin  1,ustb
    
    
    
    
    
    
    if  ((((usta+10)*100)/(ustb+10)))>135 then 
    T=T+15
    endif
    
    if (((alta*100)/altb))>135 then 
    T=T-15
    endif
    
    
    gosub motor
    
    
    
    
    
      
    
    LCDOUT $fe,2,#usta," ",#ustb," ",#altA," ",#altb   
    
    goto yap
    
    motor:
    for i=0 to 25
    PULSOUT PORTC.2,T
    PAUSEUS 20000-(T*10)
    next
    return
    
    end
    Last edited by burak450; - 1st October 2008 at 10:37.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Check power supply wiring, especially the connector, install 1000 uF 16V electrolytic capacitor and 10 nF on your pic power pin

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    For grins, try changing your BYTE values to WORDs and see what happens.
    Might be overflowing the byte values somewhere killing the program somehow someway.

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


    Did you find this post helpful? Yes | No

    Question Some ideas to look for details ...

    Hi, Burak

    I'm curious to know which testboard you use ...

    16F877A , LCD on PortB ... that sounds quite familiar.

    So, the question is ... Where do you ( geographically ) take the servo 5v supply from ???

    Alain
    Last edited by Acetronics2; - 1st October 2008 at 14:46.
    ************************************************** ***********************
    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
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Use a separate power supply for your servo.
    Regards,

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

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