Announcement

Collapse
No announcement yet.

Continuous Servo

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Continuous Servo

    Can someone point me to a tutorial on how to program the continuous servos in RobotC?
    Last edited by jillmobley; 11-19-2013, 07:39 PM.

  • #2
    Originally posted by jillmobley View Post
    Can someone point me to a tutorial on how to program the continuous servos in RobotC?
    It's actually quite simple. You set the power level of the servo using the same command you would to set the position on a standard servo:
    Code:
    servo[servoNameHere] = powerLevel;
    Values of 0-126 make it spin in reverse, with 0 being full speed in reverse. A value of 127 makes the servo sit still. Finally, values of 128-255 make it rotate forward, with 255 being full speed ahead.
    Burning Lights Programming
    FLL Team 341 Brick Chick'N Boys - Programmer (2009-2010)
    FLL Team 263 Brainy Bricks - Programmer (2010-2011)
    FLL Team 5028 Fellowship of the Brick - Youth Mentor (2011-2012)
    FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
    FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
    FTC Team 7468 Blue Chariots of Fire - Mentor/Coach (2014-2017)

    Comment


    • #3
      Do keep in mind that the standard Tetrix continuous rotation servos are designed with a "large deadband", which means a couple numbers around 127 won't make the servo move.
      Lead programmer for FTC team #6424, the 'Oly Cow.
      https://www.facebook.com/pages/The-O...60019847470634

      Comment


      • #4
        A followup question - Can number of rotations or degrees be specified while moving a continuous motor similar to encoders in DC motors? For example, move only 270 deg/ .75 rotation?

        Comment


        • #5
          Originally posted by FTC7171 View Post
          A followup question - Can number of rotations or degrees be specified while moving a continuous motor similar to encoders in DC motors? For example, move only 270 deg/ .75 rotation?
          No. The way continuous rotation servos work is the potentiometer that provides feedback inside the servo is disconnected. As such, the servo is always seeking its position, which is why it can rotate continuously. Unfortunately, this also means that there is no position feedback from the servo, so you can't make it rotate a set amount except for estimating based on time.
          Burning Lights Programming
          FLL Team 341 Brick Chick'N Boys - Programmer (2009-2010)
          FLL Team 263 Brainy Bricks - Programmer (2010-2011)
          FLL Team 5028 Fellowship of the Brick - Youth Mentor (2011-2012)
          FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
          FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
          FTC Team 7468 Blue Chariots of Fire - Mentor/Coach (2014-2017)

          Comment


          • #6
            So essentially, a continuous rotation servo is a motor with a gearbox and speed control. If you want to set position, you'll have to attach encoders and write your own PID control loop.
            Lead programmer for FTC team #6424, the 'Oly Cow.
            https://www.facebook.com/pages/The-O...60019847470634

            Comment


            • #7
              Thank you for your help with this.

              Comment

              Working...
              X