Announcement

Collapse
No announcement yet.

Digital Input causing expansion hub connection issues

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

  • Digital Input causing expansion hub connection issues

    I have an interesting one... I am using SPDT switches for limits on two mechanisms. I am using digital input 2-3 on one mechanism and input 4 on another. When the robot controller phone is attached to the expansion hub, there is an error that the hub cannot be found. Restarting the phones does not fix the issue. unplugging/plugging the USB cable does not fix the issue. What does fix the issue is unplugging both of the attached cables for the SPDT switches. As soon as they are unplugged, the expansion hub is immediately found. Better yet, re-plugging in the two cables does not create a problem and the controller and expansion hub operate normally. Normal operation will last until the phone is disconnected or other configuration changes are made. These actions will lead to the expansion hub not found error again and the removal of the digital input cables fixes the error again instantly... Any ideas?

  • #2
    It sounds like your digital input switches may be wired incorrectly.

    If you have accidentally connected the 5V pin to the 0V pin it would short out a portion the expansion hub's 5V power.

    This fault condition may be a function of the switch position... ie: shorting in one position and not in the other. So your test results my change based on the arm position.

    Note: Your switch wiring should NEVER connect the +ve supply pin (5V or 3.3V) directly to any input pin.

    Your switch should connect the input pin to ground in one position, and to a pull-up resistor when in the other position.
    (I'm not 100% sure if the pullup is even required, but you should never connect an input directly to a supply line.)

    How are your switches wired?

    Phil.


    Comment


    • #3
      I had an issue with this last year. Rule RE11 c. is the same this year. Resistors are not allowed unless recommended by the manufacturer.

      https://ftcforum.usfirst.org/forum/f...s-and-switches

      Comment


      • #4
        The switches are single pole double throw. Signal is the common position and the NO position is power and the NC position is ground. No resistors as there are supposed to be already installed in the Rev Expansion Hub. Are there pull-up resistors in the expansion hub?

        Comment


        • #5
          Additionally, once the robot is up and running (with the switches disconnected) the robot will operate as expected after the switches are reconnected. The issue is with first connecting to the hub. After connection is made, all is right with the world.

          Comment


          • #6
            Originally posted by 3805Mentor View Post
            I had an issue with this last year. Rule RE11 c. is the same this year. Resistors are not allowed unless recommended by the manufacturer.

            https://ftcforum.usfirst.org/forum/f...s-and-switches
            In the case of a switch, the sensor is a digital port and the manufacturer is MR or REV. A resistor is a passive device which is required by the sensor manufacturer; thus a pullup or pulldown resistor is legal per <RE11.c>.

            Comment


            • #7
              From the post referred to by 3805Mentor. This is how the switches are wired. Excerpt from the Rev expansion hub document states SPDT MR switch compatible w/o modifications. Just need custom cable which has been constructed. I

              Comment


              • #8
                I don't know if this will exactly help solve your problem but we had a support ticket for a similar issue with a similar limit switch:


                Those Limit Switches are wired to connect the signal (yellow wire) to power (+V, red wire, "high") when pressed and to ground (0V, black wire, "low") when not pressed. The Expansion Hub digital inputs are designed in a way that they get pulled high by default. They expect limit switches to connect the signal to ground when pressed, and make no connection when not pressed. With the default wiring of the Limit Switch, there can exist a conflict that brings down the main power for the controller, making the hub unresponsive.

                Our recommendation is to rewire the MR switch by removing the red wire. I can't tell from Modern Robotics website, but there are usually markings on limit switches: C (common), NO (normally open), and NC (normally closed). You will want to have the yellow wire connected to C, and the black wire connected to NC. That way, when the switch is sitting there in its normal state (not pressed), the switch will be closed and will connect the signal to ground (holding it low, which means false in your code). When pressed, the switch will be open and will disconnected the signal from ground (letting it go high, which means true in your code). If you need the opposite behavior (false for pressed, and true for not pressed) you can either switch the black wire to the NO position, or change your code.

                Hope that helps.

                Comment


                • #9
                  Originally posted by Michael Kaurich View Post
                  The Expansion Hub digital inputs are designed in a way that they get pulled high by default...
                  So if you want to connect a bare COTS SPST switch on the Rev hub, a pullup resistor is not needed. Just connect the SPST to signal and ground. If you want to connect a SPST to a MR CDIM, a pullup resistor IS needed. Connect a 10K ohm resistor between signal and 5V, and connect the SPST to signal and ground.

                  Comment


                  • #10
                    Originally posted by Alec View Post

                    So if you want to connect a bare COTS SPST switch on the Rev hub, a pullup resistor is not needed. Just connect the SPST to signal and ground. .
                    From my understanding that is correct. If you run into issues send some photos of the setup/harness over to support at revrobotics.com and we can go from there.

                    Comment


                    • #11
                      I have successfully used this wiring setup for normally open on the Rev hub.

                      Comment


                      • #12
                        The wiring was changed to just being round seeking as described and the issue seems to be corrected. Thanks to all for the help

                        Comment

                        Working...
                        X