Futaba servos
Andy B
Posts: 17
hi all
I·am a newbie at the robotic scene.
What i am trying to find out is how i control a servo with the pulsout command
I:E Pulsout 15,750
What i am trying to do is make a servo SCAN ( FULL LEFT THEN FULL RIGHT )
if someone could show me the code to do this i will understand it.
Then i can work out the same for UP AND DOWN
I am trying to make a simple pan and tilt using the two servos X,Y
many thanks
Andy
I·am a newbie at the robotic scene.
What i am trying to find out is how i control a servo with the pulsout command
I:E Pulsout 15,750
What i am trying to do is make a servo SCAN ( FULL LEFT THEN FULL RIGHT )
if someone could show me the code to do this i will understand it.
Then i can work out the same for UP AND DOWN
I am trying to make a simple pan and tilt using the two servos X,Y
many thanks
Andy
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
i tried this from the book:-
' Test the servo at three different position signals.
' {$STAMP BS2sx}
' {$PBASIC 2.5}
counter VAR Word
DEBUG "Center 12 o'clock", CR
FOR counter = 1 TO 150
PULSOUT 14, -100
PAUSE 20
NEXT
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 TO 150
PULSOUT 14, 1000
PAUSE 20
NEXT
DEBUG "Clockwise 2 o'clock", CR
FOR counter = 1 TO 150
PULSOUT 14, 500
PAUSE 20
NEXT
DEBUG "All done."
END
My Servos seem to not centre at all
Are servo's different in the code they need?
i am using FUTABA S3003
i tried - 100 also
but didnt seem to make any difference
andy
Try this assuming it is a standard (not continuous rotation) servo.
' {$STAMP BS2sx}
' {$PBASIC 2.5}
Counter VAR Word
RotateCCW:
FOR Counter = 500 to 1000 Step 10
'DEBUG DEC4 Counter, CR
PULSOUT 12, Counter
PAUSE 20
NEXT
RotateCW:
FOR Counter = 1000 to 500 Step 10
'DEBUG DEC4 Counter, CR
PULSOUT 12, Counter
PAUSE 20
NEXT
Reduce or increase the Step value as you experiment. Add a GOTO RotateCCW to the end of the code. Add in your DEBUG commands after the label. Download the What's Microcontroller? text, too, please. This book offers superior explanation to what you could receive on the forums. And it's not difficult to read, not to mention you can jump to the relevant section you need to read for servo control.
Ken Gracey
Parallax, Inc.
that worked wonderful, one last question.
i had to set my servo's go get full CCW and full CW as this:
' {$STAMP BS2sx}
' {$PBASIC 2.5}
Counter VAR Word
RotateCCW:
FOR Counter = 499 to 3000 Step 10
'DEBUG DEC4 Counter, CR
PULSOUT 12, Counter
PAUSE 20
NEXT
RotateCW:
FOR Counter = 3000 to 499 Step 10
'DEBUG DEC4 Counter, CR
PULSOUT 12, Counter
PAUSE 20
NEXT
that worked perfect !
Question is:- i added another part for Example:
scancentre:
FOR Counter = 1500 to 499 Step 10
'DEBUG DEC4 Counter, CR
PULSOUT 12, Counter
PAUSE 20
NEXT
this again scanned CCW and then CW then centred itself, But !
when it started the CCW scan again it spins fast (about STEP 50) to the far CW possition then does its normal slow scan
infact what i am trying to do and i have read from the book also is get the servo's to scan CCW and the CW
and return to centre position.
any ideas?
many thanxs
Andy B
i.e. counter is 499 when you end CC, but counter STARTS at 1500 in the centering part. This will cause a fast 'jump' as you describe it.
Also you should read up on ramping, it's easy to do.
Ryan
Post Edited (LostboY) : 3/17/2005 8:29:51 AM GMT
1000 uS / 0.8 uS/unit = 1250
2000 uS / 0.8 us/unit = 2500
Give those values a try and see if thing start behaving.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
i will give that a go tonight,i'm currently at work.
andy b