Shop OBEX P1 Docs P2 Docs Learn Events
Calibrating a Futaba S3003 servo for continuous rotation — Parallax Forums

Calibrating a Futaba S3003 servo for continuous rotation

NZ PeterNZ Peter Posts: 3
edited 2009-04-21 21:54 in BASIC Stamp
Hi, I am very new to the world of programming and the BS2 and I am wanting to find the center position for·a Futaba S3003 servo. I am using this code (bellow) to center them. This code was originally designed for centering a "standard" servo (i.e controlled by a 1-2ms pulse).·Using this code·my futaba servos do not move at all.·Can anyone please show me how to modify this code (or where I can find a better code) for the·servo that I have?

' Calibrate - Find the center/not moving piont for servo
' {$STAMP BS2}
' {$PBASIC 2.50}


' Variables
Servo········ PIN 15
CurrentDelay· VAR Word··· ' Servo Center Point
i············ VAR Byte


' Initialization/Mainline
LOW Servo·········· ' Set Servo pin low
CurrentDelay = 750· ' Start at 1.5 ms

DO
· DEBUG "Current Servo Delay Value = ", DEC CurrentDelay, CR
· FOR i = 0 TO 50·· ' Output servo value for 1 second
··· PULSOUT Servo, CurrentDelay
··· PAUSE 18······· ' 20 msec Cycle Time
· NEXT
· DEBUG "Enter in New Delay Value "
· DEBUGIN DEC CurrentDelay
· DO WHILE (Currentdelay < 500) OR (CurrentDelay > 1,000)
··· DEBUG "Invalid Value, Must be between 500 and 1,000", CR
··· DEBUG "Enter in New Delay Value"
··· DEBUGIN DEC Currentdelay
· LOOP
LOOP

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-21 05:28
    There's nothing wrong with the program you showed. Make sure you have the servo hooked up properly. Does the servo have power?
  • NZ PeterNZ Peter Posts: 3
    edited 2009-04-21 05:52
    Yes everything is connected properly and works for an Acoms servo that I also modified for continous rotation (I just checked to make sure). The futaba servo does a small rev when the external power supply is connected but does not respond when the code is run.

    I am using a book (123 Robotic experiments for the evil genius) and it says the code needs modification for futaba servos as they are controlled by a 1-1.5ms pulse although I don't really know how to make that modification properly
  • roadrunner3groadrunner3g Posts: 36
    edited 2009-04-21 11:30
    I have modified many servos and know that they are very touchy and need to be adjusted often. did you make sure that you have the pot connected properly and not left inside the servo? try this simple program to calibrate the center. just run program and adjust pot somewhere in the center until the servo stops moving.

    servo:
    pulsout 15, 750 ' center /// full range is 500-1000
    pause 20
    goto servo
  • NZ PeterNZ Peter Posts: 3
    edited 2009-04-21 21:54
    Thanks for the program roadrunner,

    The servo now moves! but it won't stop running despite changing the position of the pot wiper (which is a liltte trimpot that i connected to the bottom of the servo).
    Changing the range value causes the servo to pause for about 1 sec as the program gets transfered to the chip, when the servo starts up again it runs in the same direction (clockwise) at the same speed (fast).

    If I stop the BS2 (with the 6v external still connected to the servo) the servo stops. Also when I hook the servo up to and RC controller I can stop it and move it backwards and forwards by moving the pot wiper. So it must be something to do with the pulse the bs2 is sending to it.

    Ive been reading through the BS2 manual and I came accross a function called PULSIN. are there programs/code that can measure the PWM of the RC Controller so I can sort out what pulse to send my servos?
Sign In or Register to comment.