Shop OBEX P1 Docs P2 Docs Learn Events
continus servo - not understanding how to move back to an exact position — Parallax Forums

continus servo - not understanding how to move back to an exact position

jruthroffjruthroff Posts: 38
edited 2010-12-24 15:06 in Robotics
Hello,

Using the parallax continuous rotation servo (which has been centered), BS2, Pbasic 2.5 on a BOE USB. I'm also not that familiar with servos :-)

My objective is to get the servo to sweep clockwise about 340 degrees or so through a circle, and I can do that with this code...

counter VAR Word
FOR counter = 1 TO 190
PULSOUT 15, 740
PAUSE 20
NEXT
END

So far so good. But I then want the servo to sweep back counterclockwise through the same arc, about 340 degrees. I thought this would do it, but it does not...

counter VAR Word
FOR counter = 1 TO 190
PULSOUT 15, 760
PAUSE 20
NEXT
END

Using the above, the servo sweeps back about only 270 degrees. Ny expectation (hope) was that it sweep the same distance, only in the other direction.

Given that the respective pulseout values are centered on the 'no motion' value of 750, what concept about servos am I missing?

Thanks,

John

Comments

  • W9GFOW9GFO Posts: 4,010
    edited 2010-12-23 11:04
    Four things. One, a continuous rotation servo has no feedback. It has nothing to indicate to it how far it has travelled. It is strictly timing. Second, the time spent in the first loop is different than the time spent in the second. The difference in time between the two loops is equal to (1520uS - 1480uS) * 190 = 7.600 milliseconds. Third, even though you have centered the servo at 750 there is a dead band of several microseconds where it will remain motionless. It is unlikely that it is centered right in the middle of that deadband, the result is that the servo will "want" to turn one direction sooner than the other with an equal displacement of the pulsewidth. Lastly, the mechanism itself is not going to be perfectly symmetrical. There will undoubtedly be a small difference in efficiency turning one direction over the other.

    The only reliable solution to get a repeatable sweep is to use some form of feedback.

    Rich H
  • FranklinFranklin Posts: 4,747
    edited 2010-12-23 11:08
    Continous rotation servos have no way to tell where they are in the rotation and are not precision devices so you will need to work this out by trial and error and it will not always be the same. If you need to have repeatability you should get a servo or a servo and gear that can rotate 360 degrees (not continously) or look into "winch servos" which can turn 2 or 3 revolutions.
    <edit> Did a Google search and came up with these http://www.acroname.com/robotics/parts/R298-1T-SERVO.html there were many more options out there along with modifying a servo for more rotation.
  • jruthroffjruthroff Posts: 38
    edited 2010-12-23 11:36
    Thanks guys, I appreciate the quick responses!

    John
  • ercoerco Posts: 20,256
    edited 2010-12-23 14:54
    If you need one rotation or less, you could add a simple limit switch that trips in both directions to make it index and/or give some feedback.
  • ajwardajward Posts: 1,130
    edited 2010-12-24 06:27
    Hey All...

    A quick, related servo question. I've googled the topic and haven't found an answer. Does the standard servo provide some sort of feedback regarding its position?

    Thanks,

    Amanda
  • ercoerco Posts: 20,256
    edited 2010-12-24 09:11
    Yes, a standard servo uses a potentiometer (like a rotary volume control) that rotates along with the shaft to provide feedback. That gets mechanically or electrically disconnected & bypassed when it is transformed into a continuous servo, so there is no more feedback.
  • W9GFOW9GFO Posts: 4,010
    edited 2010-12-24 15:06
    ajward wrote: »
    Does the standard servo provide some sort of feedback regarding its position?

    Yes, but that feedback is internal to the servo. In other words, the servo knows what it's position is but it doesn't share that information with you. You should know pretty well what it's position is because the servo does a good job of doing what it's told, as long as it is not under an excessive load.

    Rich H
Sign In or Register to comment.