Announcement

Collapse
No announcement yet.

Servos not holding position

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

  • Servos not holding position

    I apologize i this has been asked. I searched but didn't see it. We follow the Blocks tutorial video for moving the servos and it works beautifully. When we did it in java the servos hold position, but in blocks the servos go to position and then go limp.

    servo blocks.png

  • #2
    Since you don't have a while loop block, I would expect the servos to go limp when the program exits after 10 seconds.

    Do the servos go limp immediately, or do they hold position for 10 seconds and then go limp?


    Phil.

    Comment


    • #3
      I have to check at our next meeting on Tuesday. I thought maybe I needed a while loop, but from memory (I have another coach teaching java this year) I didn't remember having to do that in java. Maybe another block that says something like set servo1 holdPostion to 0.5 would be easier for the kids to understand. I am using this with 6th graders this year.

      Comment


      • #4
        In both Java and Blocks, when the program ends the servos are disabled, which will let them sag. This is necessary in order to safely move them at the end of a match.
        The Sleep block at the end of your program would have kept the OMode running for 10 seconds.

        Yes, if you want to keep the servo holding position, then there are two options:

        1) If you are using a LinearOpmode, then you need a while loop that either continues to set the servo position, or just stops the program exiting.
        That while loop should be a while opModeIsActive loop so the program exits when you hit stop.

        2) If you are using a regular OpMode, then put the servo block in the Loop block, which will keep setting the position as long as the program is running.

        Comment

        Working...
        X