Using servos With BS2
frat
Posts: 7
Hi Friends;
Firstly I am sorry for my bad english. I have an problem with my·BS2 ·I wrote this program. I want to use servo motors with this program; first servos will go forward after backward. but it didn't
' {$STAMP BS2}
' {$PBASIC 2.0}
'right servo·pin 14
'left servo pin 0
pulse_count VAR Byte
LOW 0
LOW 14
main:
forward:
FOR pulse_count = 1 TO 25
PULSOUT 0, 1000
PULSOUT 14, 500
PAUSE 20
NEXT
PAUSE 500
backward:
FOR pulse_count = 1 TO 25
PULSOUT 0, 500
PULSOUT 14, 1000
PAUSE 20
NEXT
PAUSE 500
STOP
Could you tell me where is the mistake? I'm using tower hobbies TS-53 modified servos.
Firstly I am sorry for my bad english. I have an problem with my·BS2 ·I wrote this program. I want to use servo motors with this program; first servos will go forward after backward. but it didn't
' {$STAMP BS2}
' {$PBASIC 2.0}
'right servo·pin 14
'left servo pin 0
pulse_count VAR Byte
LOW 0
LOW 14
main:
forward:
FOR pulse_count = 1 TO 25
PULSOUT 0, 1000
PULSOUT 14, 500
PAUSE 20
NEXT
PAUSE 500
backward:
FOR pulse_count = 1 TO 25
PULSOUT 0, 500
PULSOUT 14, 1000
PAUSE 20
NEXT
PAUSE 500
STOP
Could you tell me where is the mistake? I'm using tower hobbies TS-53 modified servos.
Comments
·· What did the servos do?· How are they powered?· If you are powering the servos separately, do they have a common ground with the BASIC Stamp?· Are you able to move just one using the following code?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 9/1/2005 6:33:15 PM GMT
·· Are you sure the servos are centered properly?· When you modified them they might be uncalibrated and that could cause what you describe.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Main:
PULSOUT 14, 750
PAUSE 20
GOTO Main
it stops,
·· You didn't answer the first question though.· What are the servos doing?· Are they both running forward all the time in this code?· Or do they stop?· You should put a DEBUG in between the forward and backward routines, as well as at the end, so you can tell when things change.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
·· I'm sorry.· I'm not clear on what you're saying.· Are you saying the servos move forward, stop, then go forward again?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
' {$STAMP BS2}
' {$PBASIC 2.0}
pulse_count VAR Byte
LOW 0
LOW 14
main:
forward:
FOR pulse_count = 1 TO 25
DEBUG DEC pulse_count
PULSOUT 0, 900
PULSOUT 14, 600
PAUSE 20
NEXT
PAUSE 500
backward:
FOR pulse_count = 1 TO 35
PULSOUT 0, 600
PULSOUT 14, 900
DEBUG DEC pulse_count
PAUSE 20
NEXT
PAUSE 500
STOP
And in debug screen ı saw·from 1 to 25 numbers not from 1 to 35 so ı think my micro reads from begining·to·pause 500 code·after it turns programs begining·in other words restarts.· problem continues...
·· It is browning out the Stamp Module somehow.· Are you powering the Stamp Module from the same 6 volts as the servos are running from?· If so, try powering the Stamp from a separate supply.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com