Servo not reaching full travel


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Hmmm

    Let's just go over the basic idea:

    Center position of futaba servo is 1.52ms puls length sent approx every 20 ms. To move it to min position 1 ms and to max position 2 ms.

    But when I recently did a thingy for a RC receiver I found out that the pulses are acctually more in the 0.8 ms - 2.2 ms range to allow for trim settings.

    If you plan to have more than one servo I would recommend you to have a look at DT software PWM.

    If you want to have bigger movement try to change your limit values.

    /me

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Jumper,

    when you say change the limit values you mean the :

    If pos < 1800 Then

    and

    If pos > 25 Then

    right ?

    I added a lcd and did some studies. I did increased the upper value but the servo just stops when it reaches +- 1500.

    The center is 700

    I cant work with numbers bellow 0 i'm affraid.

    The plan is to have only one servo, but i need to use it with more travel ( not continuous ) as 90º is too short

    .

  3. #3
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Try this

    Hi,

    Hook up a 10k potentiometer (or whatever you have in your drawer) to i.e AN0. Vdd on one side of the pot. GND on the other and the wiper goes to AN0. Put a 0.1 uF cap between wiper and GND to reduce noice .Connect the servo on i.e PORTB.1 ... if you use a voltage meter on the wiper and adjust the voltage to ~3 V you should get a 1.5 ms pulse every 20ms. Now you can turn the pot and then you can try the end positions... your LCD will be great here.


    DEFINE ADC_BITS 8

    ' DEFINE YOUR LCD SETTINGS HERE

    SERVO1 Var PORTB.1
    AD0 var word
    SERVO1_Pulse var byte
    Total_Delay var word
    n var byte

    TRISA 255 ' PORTA to input
    ?????????? 'set up as analog CHECK DATASHEET for you PIC
    ?????????? ' turn off comparators CHECK DATASHEET

    n=0
    Goto main


    update_LCD:
    n=0 'reset LCD loop counter
    'Here you write your LCD code to send the Servo1_pulse value to your LCD
    RETURN

    main:

    ADCIN 0, AD0 'READ POT
    SERVO1_Pulse=AD0*10 'Scale value max = 2550 us
    SERVO1=1 'Start the servo pulse
    Pauseus(SERVO1_Pulse) 'wait a while
    CH1=0 'Stop the pulse
    Total_Delay=(20000-Servo1_Pulse) 'calculate loop delay so we
    Pauseus(Total_Delay) 'get approx 20 ms loop time
    N=n+1
    if n>=50 then gosub update_LCD 'update LCD every 50 loops i.e once per second
    goto main

    end


    try it and if it doesnt work let me know so I can help. This code is untested but should work if you set up the analog port correctly. After this you will atleast know how far your servo will travel.

    /me
    Last edited by Jumper; - 22nd December 2007 at 12:58.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi Jumper,

    Fist of all thanks for your help

    I had some issues with your code but i got the idea ( nice one by the way )

    The problem is that even so the servo just moves a total of 90º

    I've googled a bit and for futaba servos they state that you need :

    center : 1,5ms
    0º : 1ms
    120º : 2ms
    30º : 1.16ms

    ( stop time can vary from ~15ms to 30 ms - not critical )

    I'm not being able to apply this to my servos

    Even with a simple pauseus 1000 ( that should be 1ms and the servo should center ) this does not happen

    .

  5. #5
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Try again

    Do you have more servos? Try a different one since the one you are using might be bad.

    If you connect the servo to a normal RC receiver what result do you get then?


    /me

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    center : 1,5ms
    0º : 1ms
    120º : 2ms
    30º : 1.16ms
    Even with a simple pauseus 1000 ( that should be 1ms and the servo should center ) this does not happen
    .
    It looks to me like you might be confusing a couple of the values you stated above.
    From what I'm seeing, you want 1000 to be center and work around that. That's all fine and dandy, but you want the rest of the program to work around it also, which it isn't doing.
    Instead of thinking about it in terms of 0, 90, 120, whatever degrees, think of it in terms of -90 , 0 , +90, etc. degrees, where 0 is center.

    Using your original code...with a few changes...

    Code:
    '.....set up your ports, adcon, cmcon, whatever else is required...
    
    leftend = 1000
    center = 1500
    rightend = 2000
    stepval = 50
    pos = center
    
    moveleft:
    pause 19 'pause 19ms
    if pos > leftend then
    pos = pos - stepval
    else
    goto moveright
    endif
    servo = 1 : pauseus pos : servo = 0 : goto moveleft
    
    Moveright:
    pause 19 'pause 19ms
    if pos < rightend then
    pos = pos + stepval
    else
    goto moveleft
    endif
    servo = 1 : pauseus pos : servo = 0 : goto moveright
    
    end
    And with that code, when pos = 1500, the servo should be centered. pos decreases to leftend, servo moves left, pos gets to leftend, jumps to other loop, pos increases to rightend, servo moves right, pos gets to rightend, jumps to other loop, and over and over.
    Change the value of stepval to change how fast the servo moves back and forth. Simple enough.
    But if it really doesn't work, and your ports are set up correctly, you've got the right config fuses set, etc.etc., then, as Jumper said, it sounds to me like a goofy servo. What kind of Futaba servo are you using? A standard S148 or what?

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Jumper, skimask,

    i did some more digging but all returning to the same thing...

    I tryed skimask's code and the servo uses no more same travel than before.

    I'm using a Futaba's S3152 which is a good servom ( IMO ) ...and so i left the "bad servo" mark to the end.

    I tryed it with a receiver and same thing.

    I'm guessing the servo is really goofy.

    .

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Jumper, skimask,
    i did some more digging but all returning to the same thing...
    I tryed skimask's code and the servo uses no more same travel than before.
    I'm using a Futaba's S3152 which is a good servom ( IMO ) ...and so i left the "bad servo" mark to the end.
    I tryed it with a receiver and same thing.
    I'm guessing the servo is really goofy.
    .
    Does it move equal distances to the 'left' and 'right' as measured from 'center'? Or is one more than the other? What happens if you change 'leftend' to 500 and 'rightend' to 2500? Does it bind at one end or the other?
    Are you sure you're PIC is running at the same oscillator speed as you have DEFINE'd?

    I haven't done any checking lately, but, is a Futaba S3152 a 'standard' servo? Is it one of the new digital servo's? I don't have any of those, I haven't played with them, so I don't know about their operational characteristics. I'd ASSUME they would operate the same if they're backwards compatible, but I could be wrong...

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