Shop OBEX P1 Docs P2 Docs Learn Events
Servo continues to run after program executed — Parallax Forums

Servo continues to run after program executed

kperlettikperletti Posts: 5
edited 2013-01-14 22:09 in BASIC Stamp
After running a servo tutorial, there were two issues which I'm seeking further insight:

1) The servo would indefinitely continue to rotate ~5 deg counterclockwise after program was finished executing.
Any ideas what could cause this?

2) The servo was supposed to go CCW to 10 o-clock position, then CW to 2 o-clock, then CCW to 12 o-clock but instead went to 12 o'clock, then CW to 4 o'clock then CCW to 2 o-clock.
Does the servo have internal position sensor that could be off? What may cause this?

Comments are appreciated!

Comments

  • ercoerco Posts: 20,257
    edited 2013-01-14 10:59
    1) stick an END command at the end of your program, or else add a DO and a LOOP to avoid a reset every 2.3 sec which may be glitching your servo

    2) servo is moving in the right pattern, you could either add/subtract a fixed value from all of your pulsout values, OR
    just manually remove & reorient your servo horn 2 positions CCW.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-01-14 15:50
    erco wrote: »
    1) stick an END command at the end of your program, or else add a DO and a LOOP to avoid a reset every 2.3 sec which may be glitching your servo

    I think Erco meant, "STOP" instead of END. :innocent: An END is implied when the program runs out of instructions to execute.
  • ercoerco Posts: 20,257
    edited 2013-01-14 17:16
    Yep, oops, sorry, & thanks Chris!
  • kperlettikperletti Posts: 5
    edited 2013-01-14 21:38
    Thanks Chris and Erco!

    STOP cmd fixed the issue.
  • bluejaybluejay Posts: 131
    edited 2013-01-14 21:51
    erco wrote: »
    1) stick an END command at the end of your program, or else add a DO and a LOOP to avoid a reset every 2.3 sec which may be glitching your servo

    2) servo is moving in the right pattern, you could either add/subtract a fixed value from all of your pulsout values, OR
    just manually remove & reorient your servo horn 2 positions CCW.

    What Erco is saying about the servo is continually running a bit after the completion of coding is that the internal gears inside the servo will eventually settle
    into its own proper location due to the mechanic structure of the gears. By adding a DO and LOOP to the coding it (gear running ) will resolve the problem.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-01-14 22:09
    erco wrote: »
    Yep, oops, sorry, & thanks Chris!

    I knew what you meant. =)
Sign In or Register to comment.