Announcement

Collapse
No announcement yet.

Help with disable Servo Controller pwmDisable()

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

  • Help with disable Servo Controller pwmDisable()

    Hi,

    Our team moved some servos to comply with the current limits, and later found there are some things we don't understand about the controller.pwmDisable(); command. We promptly burnt out a servo in the process.

    Currently the module has several servos on it, and we need a servo used in the hanging mechanism to be disabled.

    If we call the controller.pwmDisable(); with a button press, all seems fine, things are disabled. But if we tap the joystick again (if they are near zero, no set servo position commands are issued) the servo becomes enabled again. Likewise if any other servo on the same module is moved after the disable button is pressed.

    Is that the expected behavior of this function?

    Our servo burnt out because after the move, there were other servos on the controller that were being explicitly set during each loop (from ftc example code- is that not a good practice?) so the controller after the move was in fact not being disabled.



    One step further, Once the disabled button is pressed we tried explicitly setting the controller as disabled for each loop (as opposed to the single occurrence above)

    The results here are also dependent on the order of the code. if the disable command is the last thing in the loop, every thing seems as expected, the servos all stay disabled and we cannot move them.

    If the disable command is prior to the servo statement, the servos will move, but they are also in a part time 'disabled' mode, ie we can move them by hand, but they are also clearly trying to get to their set positions, this can be dramatic...

    So it still seems like any call to set a position to a servo on the controller overrides the disable function and re-enables the controller in our hands. It's hard to imagine that is the default mechanism that you would expect from disabling the servo controller.


    Thanks for any understanding you can offer.


    Rick

  • #2
    Rick,

    The operations you describe are as expected.

    From a servo controller in a disabled state, once ANY servo has power applied (setPosition command), then every servo on the controller will have PWM power applied. By default the PWM will go to the last known position of each servo or some unknown value if the servo position was never set.

    If you want one servo PWM to be totally disabled while powering other servos, then the disabled servo has to be on its own controller.

    FTC Team 8881.

    Comment


    • #3
      You could split it up into different subsystems. Just initialize it separately when you're running teleOp.

      Comment


      • #4
        Originally posted by korimako View Post
        If we call the controller.pwmDisable(); with a button press, all seems fine, things are disabled. But if we tap the joystick again (if they are near zero, no set servo position commands are issued) the servo becomes enabled again.
        Clearly some set position command is being issued. Setting the servo to the same position it was in or setting it to a different value and then back counts as setting it and will re-enable the PWM. The commands are not actually sent to the servo controller until loop() terminates, so it makes sense that re-disabling the PWM on the servo controller will remove the effect of calling setPosition().

        Comment


        • #5
          Originally posted by FTC8881 View Post
          Rick,

          The operations you describe are as expected.

          From a servo controller in a disabled state, once ANY servo has power applied (setPosition command), then every servo on the controller will have PWM power applied. By default the PWM will go to the last known position of each servo or some unknown value if the servo position was never set.

          If you want one servo PWM to be totally disabled while powering other servos, then the disabled servo has to be on its own controller.

          FTC Team 8881.
          Thanks. Is there a documentation resource, where I would have been able to find such a description? I did some looking but couldn't find anything. Too much for me to dig through the code to decipher this.



          As a summary for everyone , PWM disabling is at the controller level. controller.pwmDisable() is really only a 'Disable until any servo on the controller gets set to a position'

          And, in loop mode, commands are really only executed after the loop finishes, so latter commands take precedence.

          Comment


          • #6
            Yes, our team did the same thing. We put the hanger servo by itself on a separate servo controller. We could put some other servos on it too as long as we won't touch them when hanging. You are correct that once any of the servos on the controller is "set", PWM is enabled for the entire controller. Just for flexibility, we added a feature in our library that if servos that don't need to fight any load, we can put them on the same servo controller and our servo class overrides the set method so that it will set the servo position, wait for a specified period of time for the movement to complete and then disable PWM. So even if I need to "set" another servo on the same controller, it will just come back ON for under a second and will be disabled again.

            Comment

            Working...
            X