Shop OBEX P1 Docs P2 Docs Learn Events
Using servos With BS2 — Parallax Forums

Using servos With BS2

fratfrat Posts: 7
edited 2005-09-01 20:36 in BASIC Stamp
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.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 18:33
    frat,

    ·· 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?

    Main:
      PULSOUT 14, 500
      PAUSE 20
      GOTO Main
    


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 9/1/2005 6:33:15 PM GMT
  • fratfrat Posts: 7
    edited 2005-09-01 18:37
    Servos are only going forward . And yes, they have a common ground with the bs2 they are powered from un regulated 6 volts.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 18:39
    frat,

    ·· 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
  • fratfrat Posts: 7
    edited 2005-09-01 18:42
    I'm sure the servos centered when ı wrote
    Main:
    PULSOUT 14, 750
    PAUSE 20
    GOTO Main
    it stops,
    :'(
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 18:48
    frat,

    ·· 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
  • fratfrat Posts: 7
    edited 2005-09-01 18:52
    When program starts servos are starting to go forward all the time in this code, after it little bumps and they replies going forward.
    :'(
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 19:00
    frat,

    ·· 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
  • fratfrat Posts: 7
    edited 2005-09-01 19:02
    yes, but very little stopping; for half second.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 19:11
    And you're using a BASIC Stamp 2?· Not a BS2p or something else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • fratfrat Posts: 7
    edited 2005-09-01 19:14
    yes BS2, every thing seems true :'( but something is wrong and ı don't know
  • fratfrat Posts: 7
    edited 2005-09-01 20:02
    I changed program a little only ı added debug code.
    ' {$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.sad.gif· problem continues...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-01 20:36
    frat,

    ·· 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
Sign In or Register to comment.