Shop OBEX P1 Docs P2 Docs Learn Events
Is my servo broken? (w/ Video) EDIT: Won't Respond Anymore. It's probably broke — Parallax Forums

Is my servo broken? (w/ Video) EDIT: Won't Respond Anymore. It's probably broke

NeodudemanNeodudeman Posts: 3
edited 2009-04-27 20:22 in BASIC Stamp
Hello,

I have here a Parallax Standard Servo, and it only spins bout 90 degrees from the pulsout range of 500 to 1000.

Is this normal?

Here's a link to a video of it: www.youtube.com/watch?v=eua0iwpVJdQ

In the vid, the servo is controlled with a pot resistor, and code taken directly from the "What is a Microcontroller?" Parallax book.

' {$STAMP BS2}
' {$PBASIC 2.5}

scaleFactor CON 200 '500(servo minimum) / 640 (pot max) * 256
offset CON 500
rcPin CON 10
delay CON 10
servoPin CON 14

time VAR Word

Do
  HIGH rcPin
  PAUSE delay
  RCTIME rcPin, 1, time
  time = time */ scaleFactor
  time = time + offset
  PULSOUT servoPin, time
  DEBUG HOME, DEC5 time
LOOP


Post Edited (Neodudeman) : 4/27/2009 3:28:16 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-27 14:17
    Normally you get more like 180 degrees rotation over a pulse range of 1ms to 2ms. Most likely you have an error in your program and you're not really producing pulses over the range you think you are. One easy test is to make a program that produces a 1ms pulse for a second or so, then produces a 2ms pulse for a second or so, then repeats. For a BS2, this might be something like:
    i           var    byte
    servo    pin    13   ' or whatever
    start:
    for i = 1 to 100
    pulsout servo,500
    pause 20
    next
    for i = 1 to 100
    pulsout servo,1000
    pause 20
    next
    goto start
    
  • dandreaedandreae Posts: 1,375
    edited 2009-04-27 14:23
    Try changing your offset to 10.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • NeodudemanNeodudeman Posts: 3
    edited 2009-04-27 14:33
    @ Mike
    The thing about that, is, my Debug Terminal is outputting that I am pushing out numbers 500 to 1000

    @ Dave
    I just tried it, and the servo didn't move. Now, it won't even move with the original program.

    I think it's officially broken now, cause it just clicks at me, and doesn't move.
  • dandreaedandreae Posts: 1,375
    edited 2009-04-27 14:52
    Try this code and see?· This worked for me.



    ' {$PBASIC 2.5}
    scaleFactor CON 50 '500(servo minimum) / 640 (pot max) * 256
    offset CON 10
    rcPin CON 7
    delay CON 6
    servoPin CON 14
    time VAR Word
    DO
    · HIGH rcPin
    · PAUSE delay
    · RCTIME rcPin, 1, time
    · time = time */ scaleFactor
    · time = time + offset
    · PULSOUT servoPin, time
    · DEBUG HOME, DEC5 time
    LOOP

    Dave


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-27 14:56
    It might be broken. You may also have run out of power.

    1) It helps to provide adequate information. You didn't say what Stamp you're using, what power source. Even if you've got dead batteries now, you still might have made an error in typing your program. You didn't mention that you're displaying the values you're using for the PULSOUT statement. The more thorough your information, the better the advice you'll get. It always helps to attach a copy of your source program to your message (don't cut and paste it if possible). Use the Attachment Manager (when you Post Reply).

    2) Try fresh batteries. If all else fails, call Parallax Tech Support.
  • NeodudemanNeodudeman Posts: 3
    edited 2009-04-27 15:25
    Mike Green said...

    1) It helps to provide adequate information. You didn't say what Stamp you're using, what power source. Even if you've got dead batteries now, you still might have made an error in typing your program. You didn't mention that you're displaying the values you're using for the PULSOUT statement. The more thorough your information, the better the advice you'll get. It always helps to attach a copy of your source program to your message (don't cut and paste it if possible). Use the Attachment Manager (when you Post Reply).

    Well, I did quote the source out in [noparse][[/noparse]code] brackets in my first post that included the {$STAMP BS2} tag, and the DEBUG HOME, DEC5 time logic.
    I guess you didn't see it? I really was trying to put out all the information I could. I mean, heck, I recorded a video and uploaded it to YouTube to illustrate the problem.

    Dave, I did try your code, and the servo simply isn't responding anymore. It won't even respond to my old code. I think it's officially broken now.

    Thanks for the help, anyway.
  • dandreaedandreae Posts: 1,375
    edited 2009-04-27 20:22
    Are you able to give me a call at 1-888-997-8267?· If not, send me an e-mail at dandreae@parallax.com and I will work with you to get this up and running.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
Sign In or Register to comment.