Some questions regarding a servo motor's data sheet.


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    Currently I am using gear wheels to make the 180° servo rotate a shaft 360°.
    Last edited by selbstdual; - 4th May 2008 at 14:27.
    Be well - whoever you are.

  2. #2
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    For a better understanding, I uploaded a video: Here: http://rapidshare.com/files/112603057/c.avi.html which is 2 minutes long. You will need the xvid codec aswell as a mp3-codec. You should see that the part moving is almost parallel to the cam when being in position X. In software I tell the program to make the servo turn back to the old position as mentioned. But it doesn't as you can see.

    And I would like you to tell me why.

    EDIT: OR here if you prefer some service like youtube: http://www.revver.com/video/863645/problem-with-servo/
    Last edited by selbstdual; - 5th May 2008 at 13:45. Reason: Revver-Link
    Be well - whoever you are.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    It seems more like a code problem than hardware. Can you post the code here and let us try to work out what's happening.

    Are you refreshing the pulse width every 20 ms ? Normally you send the 1ms - 2ms pulse width to the servo every 18 - 20 ms so that the servo holds its position and via the feedback pot knows its position. It looks as if the code is not sending the pw every 20ms or that the servo is mis-reading it and losing its starting point, so on each instruction it trys to move 180 but hits the limits and thus results in limited travel.

  4. #4
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    On a 16f628a
    Code:
    @ DEVICE MCLR_OFF
    @ DEVICE hs_osc
    @ DEVICE wdt_off
    @ DEVICE lvp_off
    @ DEVICE protect_off
    
    Define OSC 20
    INTCON = 0
    CMCON = 7
    TRISA = 0
    TRISB = 0
    
    StepsRotating CON 93
    RotatingMin CON 267
    RotatingMax CON 1218
    
    
    Position VAR WORD
    PositionBefore VAR WORD
    Counter VAR WORD
    PositionBefore = 0
    LR VAR BYTE
    RotatingPos VAR WORD
    Movement VAR WORD
    
    ServoMotor VAR PORTB.1
    
    GOSUB RoutineStartingPos
    
    ES:
    LR = 1
    RotatingPos = RotatingMin
    ES_HS: 
    ES_HS_Drehung:
    WHILE 1 = 1
        IF LR = 1 THEN
            WHILE RotatingPos < RotatingMax
                GOSUB RoutineRotate
                RotatingPos = RotatingPos + StepsRotating           
            WEND
            LR = 0
        ENDIF
        IF LR = 0 THEN
            WHILE RotatingPos > RotatingMin
                GOSUB RoutineRotate
                RotatingPos = RotatingPos - StepsRotating           
            WEND
            LR = 1
        ENDIF 
    WEND
    END
    
    RoutineRotate:   
        FOR Movement = 0 TO 1000 / 20   
            Low ServoMotor
            Pulsout ServoMotor,RotatingPos
            Pause 20
        NEXT Movement 
        RETURN
    
    RoutineStartingPos:
        FOR Counter = 0 TO 1000 / 20 
            Low ServoMotor
            Pulsout ServoMotor,(RotatingMax+RotatingMin)/2
            Pause 20
        NEXT Counter 
        RETURN
    Last edited by selbstdual; - 5th May 2008 at 13:58.
    Be well - whoever you are.

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


    Did you find this post helpful? Yes | No

    Talking

    the answer to your "problem" contains ... 1/2*J*Omega^2

    with Omega as the second derivative of rotation ...

    Ha,ha,ha

    You got your fine calculations "into the teeth" ...

    LOL !

    A "Hong Kong" servo, I suppose ... certainly not a "King Kong" one.

    Alain
    Last edited by Acetronics2; - 5th May 2008 at 16:35.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  6. #6
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Unhappy

    Poor old man.
    Be well - whoever you are.

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


    Did you find this post helpful? Yes | No

    Talking

    I had forgotten some false additions in your soft ... but that was not the "non return" reason ...

    just leads to bump your mechanical rotation limits ... might be some resulting damages too ... who knows ?

    Was a pleasure, Mr Tax Inspector.

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

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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