Shop OBEX P1 Docs P2 Docs Learn Events
Mini servo help — Parallax Forums

Mini servo help

WildatheartWildatheart Posts: 195
edited 2009-08-13 11:32 in BASIC Stamp
I am using a HiTech servo HS 55 (mini servo) and am trying to drive it with a BS1.· I have 50 feet of control cable between the BS1 and the servo.

The following program does move the servo horn to a very minor extent but does not provide·the required·motion.

I do not need to "hold position" beyond that of where the servo is supposed to stop or start.

' {$STAMP BS1}
' {$PBASIC 1.0}


SYMBOL counter· = B0
INPUT 4
INPUT 1
INPUT 2
INPUT 3
OUTPUT 5
HIGH 5
OUTPUT 6
HIGH 6
OUTPUT 7
HIGH 7

Main:

· IF PIN2 = 1 THEN Camera_On
·' IF PIN1 = 1 THEN Zoom_Out
·' IF PIN4 = 1 THEN Still_Shot
·' IF PIN3 = 1 THEN Zoom_In
GOTO Main


Camera_On:
DEBUG "camera On"
FOR counter = 1 TO 20
PULSOUT 7, 120
PAUSE 200
NEXT
FOR counter = 1 TO 200
PULSOUT 7, 10
PAUSE 200
NEXT
LOW 7
GOTO Main

'Zoom_Out:
'DEBUG "Zoom Out"
'GOTO Main

'Still_Shot:
'DEBUG "Still shot"
'GOTO Main

'Zoom_In:
'DEBUG "Zoom In"
'GOTO Main


Does anyone have suggestions as to why the servo motion is so limited?

The specifications for the HS 55 can be found at http://www.hitecrcd.com/servos/show?name=HS-55

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-13 04:09
    Any servo requires control pulses about every 20ms with a pulse width roughly between 1.0ms and 2.0ms. Some servos will accept control pulses from about 0.5ms to 2.5ms. The BS1 uses a PULSOUT granularity of 10us, so PULSOUT 7,120 will produce a 1.2ms pulse and PULSOUT 7,10 will produce a .1ms pulse which the servo may ignore.

    Try a PAUSE 20 instead of a PAUSE 200.

    Try a PULSOUT 7,100 for one end of the range and a PULSOUT 7,200 for the other end of the servo range. If it looks like there should be wider motion, try as low as PULSOUT 7,50 and as high as PULSOUT 7,250.
  • ManetherenManetheren Posts: 117
    edited 2009-08-13 11:32
    did you try running this next to the bs with a short control line first? I do not know the limitson the length of the cable before it will not transfer the correct signals.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tia'Shar Manetheren
Sign In or Register to comment.