Servo not reaching full travel


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    This also means that center is not where i though it was .
    How are you quantifying 'CENTER' on the servo right now? I mean how are you determining 'center'?
    Are you trying to let the program do it for you?
    Are you moving it manually from end to end and splitting the difference and making a mark at that 'center'?
    If you're looking at center and saying that's 'CENTER' because you want it to be center, well, that ain't gonna work.
    Take that manual method described above of moving the servo and write a program to send the servo a 1.5ms pulse and see how far off the two marks are. Let the servo tell YOU where center is.

    If you are still running that code in your second post, I think you should abandon that code until you figure out how to get full left and right out of your servo's first, before you start adding in buttons and stuff...
    Go back to that code in Post #9 and play with that.
    Using those values, the servo should move equally left and right (not just a little left and a lot right, 'cause that would mean that your idea of center and the servo's idea of center are two different things, which I think is wrong) and it should do that without binding at either end.
    Last edited by skimask; - 27th December 2007 at 22:23.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    skimask,

    i ran my code and yours ( as transcribed bellow ) and this was what i got ( please see attached pic ):

    Manually found left and right limits of this servo and marked it's true center

    Fisical center matches the 1500 ms impulse

    With my code:
    max right = +- 2150ms
    max left = +- 1025 ms

    With your code :

    max right = +- 1950 ms
    max left = +- 1025 ms

    both are far from servo fisical limits ( fisical limits marked with in red )



    your code :

    '************************************************* ****************************
    '19/12/2007
    '
    'Skimask's servo code
    '
    'PIC 16F628 @ 4Mhz

    '************************************************* ****************************
    'Config

    PIE1 = 0 'off
    PIR1 = 0 'off
    CMCON = 7 'comparator off
    VRCON = 0 'Vref Off
    T1CON = 0

    ' internal osc selected in IC prog
    ' MCLR ON selected in IC prog

    '************************************************* ****************************
    'DEFINEs
    '************************************************* ****************************

    'OSC

    DEFINE OSC 4

    '************************************************* ****************************
    '
    'LCD

    ' DEFINE LCD pins
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 2
    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4

    DEFINE LCD_COMMANDUS 2000

    '************************************************* ****************************
    ' variables

    va1 var word
    va2 var word
    ser var word
    pos var word
    na var word
    nb var word
    stepval var word
    center var word
    leftend var word
    rightend var word

    CLEAR

    '************************************************* ****************************
    'I/O's

    PORTA = %00000000
    PORTB = %00000000

    TRISA = %00000011
    TRISB = %00000011

    '************************************************* ****************************
    'PINS

    bu1 var PORTA.0
    bu2 var PORTA.1
    R_S var PORTA.2
    E var PORTA.3
    a4 var PORTA.4
    MCLR var PORTA.5
    a6 var PORTA.6
    a7 var PORTA.7

    DATA1 var PORTB.4
    DATA2 var PORTB.5
    DATA3 var PORTB.6
    DATA4 var PORTB.7

    bu4 var PORTB.0
    bu3 var PORTB.1
    led var PORTB.2
    servo1 var PORTB.3


    '************************************************* ****************************
    '************************************************* ****************************

    pause 200 'init LCD
    lcdout $fe,1 'clear LCD

    Start:

    leftend = 1000
    center = 1500
    rightend = 2000
    stepval = 20
    pos = center

    moveleft:
    pause 19 'pause 19ms
    if pos > leftend then
    pos = pos - stepval
    else
    goto moveright
    endif
    servo1 = 1 : pauseus pos : servo1 = 0 : goto moveleft

    Moveright:
    pause 19 'pause 19ms
    if pos < rightend then
    pos = pos + stepval
    else
    goto moveleft
    endif
    servo1 = 1 : pauseus pos : servo1 = 0 : goto moveright

    end




    EDIT:

    I just changed your settings to :
    leftend = 500
    center = 1500
    rightend = 2500

    and i got more travel to the right ( more that i got before with mine )
    This means that the servo is working bellow 1ms
    Attached Images Attached Images  
    Last edited by ruijc; - 28th December 2007 at 15:49.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Just an update of my previous post:

    I changed the values as far as :

    leftend = 200
    center = 1500
    rightend = 3000

    ( the servo moved a bit more but stopped before reaching it's fisical limits. Also, these values do not represent the true extreme limits )

    The new max travel made by the servo is marked in this new picture.

    .
    Attached Images Attached Images  

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I'm thinking (supposing really) that maybe just because a servo has a physical limit, doesn't mean that the electronics inside will let it reach those physical limits. I don't know.
    Those marks you made, the black ones, look like a halfway decent 90 degree angle.

    How about trying this out for grins:
    Code:
    ....all the setup you've already got...it looks like it should work just fine....
    Start:
    leftend = 100 : center = 1500 : rightend = 2900 : stepval = 20 : pos = center
    
    moveleft:
    pauseus 20000 - pos  'pause 20ms - servo pulse width, should keep a more constant refresh rate closer to 50hz
    if pos > leftend then
    pos = pos - stepval
    else
    goto moveright
    endif
    servo1 = 1 : pauseus pos : servo1 = 0 : goto moveleft
    
    Moveright:
    pauseus 20000 - pos  'pause 20ms - servo pulse width, should keep a more constant refresh rate closer to 50hz
    if pos < rightend then
    pos = pos + stepval
    else
    goto moveleft
    endif
    servo1 = 1 : pauseus pos : servo1 = 0 : goto moveright
    
    end
    I changed it a bit, added a bit of code to keep the refresh rate a bit closer to 50Hz. Maybe the newer servo's are a bit more sensitive to that sort of thing.
    Also, I changed leftend and rightend to EXTREME values. They're almost GUARANTEED to bind your servo's at the extreme's.
    See what happens.
    Are you actually using a real 16F628 or a 16F628A?

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Hi skimask,

    i'm using a 16F628A.

    With your new code the servo moves all the way up to the new red marks ( as showned in pic # 2 ).

    It is still not at it's fisical limit but i think that probably these are the electronic limits of the servo.

    .

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Hi skimask,
    i'm using a 16F628A.
    With your new code the servo moves all the way up to the new red marks ( as showned in pic # 2 ).
    It is still not at it's fisical limit but i think that probably these are the electronic limits of the servo.
    .
    Could be the electronic limit thing saving the servo and the gears themselves. Maybe get your hands on an older analog type (i.e. S148) and see what happens.

    Also, you said that your center isn't quite right. Could be because you're using the internal oscillator and it's not quite on spec. Datasheet says you could have up to about 5% slop on that (Table 17-5).

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


    Did you find this post helpful? Yes | No

    Talking Rtfds !!!

    Hi,

    Just remember this is a DIGITAL Servo, and digital servos have "software" programmed travel limits ...

    from the Datasheet ...

    << This digital servo cannot be used with the following * AM *
    transmitters as the servo neutral signal is: 1310us).
    CONQUEST AM, FG Series (T4FG, T5FGK,T6FG, T6FGK, T7FGK), New Terratop,
    T3EGX, T3PGE, T2NL, T2LGX, T2FR, T2PK series.

    ***** Do not use digital servos with older AM systems *****
    >>

    Some brands, like hitec, sell the programming box to trim your own parameters ( travel, speed ... etc.)

    They also can recognize a valid signal frame ...

    so, shortly said, they do not allow you to make "uncontrolled things" ...

    Once more reading the servo DATASHEET could have helped !!! ...

    Alain
    Last edited by Acetronics2; - 29th December 2007 at 10:32.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Acetronics,

    true about that...

    BUT

    If it wasnt for skimask i woudnt be able to get that extra travel


    PS. - do you have the link for the s3152 datasheet ?
    .

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