Currently I am using gear wheels to make the 180° servo rotate a shaft 360°.
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.
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.
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.
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.
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 " !!!
*****************************************
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 " !!!
*****************************************
Bookmarks