Skip to content

Update Alt text for the ESD mitigation page. #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,71 @@ Control Hub Ports
=================

.. figure:: images/CH-HUB.png
:align: center
:alt: Control Hub
:alt: REV Control Hub

REV Control Hub (REV-31-1595)
Part number REV-31-1595

.. include:: std-ports.rst


.. figure:: images/CH-HUB-FRONT.png
:align: center
:alt: Control Hub Ports
:alt: The ports from left to right are: USB 2.0, USB 3.0, USB C, USB Mini (below the USB C port), HDMI, and Micro SD.

Control Hub Front Ports

USB Ports
---------

USB-A Ports
-----------
Universal Serial Bus (USB) is an industry standard that allows data exchange and delivery of power between many types of electronics.
The control hub has four USB ports described below.

A Control Hub has both a USB 2.0 and 3.0 Type-A female port. This is primarily
used for connecting UVC Cameras in acccordance with ``<RE14>``.
USB 2.0 and USB 3.0 refer to the USB specifications that relate to data exchange rate and power delivery.

USB-B Port
----------
USB Type-A and USB-C and USB Mini-B refer to the type of connector.

On a Control Hub, the USB-mini-B port is used only to communicate directly to
the I/O system. In this case, it is only for the purpose of uploading firmware
to the device.
- USB Type-A is a larger rectangular connector.
- USB-C is a smaller oval connector.
- USB Mini-B is a smaller rectangular connector with a beveled edge.

USB 2.0
^^^^^^^

This is a female USB Type-A port that implements USB 2.0 and can be used for connecting USB devices as allowed for in the Competition Manual.

.. warning:: An ESD event on the USB 2.0 port on the Control Hub can cause Wi-Fi disconnects.

The REV Control Hub has a
`known ESD issue <https://docs.revrobotics.com/duo-control/troubleshooting-the-control-system/troubleshooting-the-control-system#esd-mitigation-techniques>`_
with devices plugged into the USB 2.0 port.
Using the USB 2.0 Port may cause ESD to affect your Control Hub's Wi-Fi Chip (causing Wi-Fi disconnects with the driver hub).
Ensure that you plug USB devices, such as a Camera, into the USB 3.0 Port on your Control Hub.

USB 3.0
^^^^^^^

USB-C Ports
-----------
This is a female USB Type-A port that implements USB 3.0 and is primarily used for connecting USB video device class (UVC) cameras (webcams).

A Control Hub has a USB-C port. This is primarily used for connecting to a
laptop for loading the SDK but can also be used with a UVC Camera in
acccordance with ``<RE14>``.
USB C
^^^^^

A Control Hub has a female USB-C port that implements USB 2.0. This is primarily used for connecting to a
laptop for loading the SDK but can also be used with a UVC Camera.

MINI USB
^^^^^^^^

This is a female USB Mini-B port that implements USB 2.0. It is used only to communicate directly to
the I/O system. In this case, it is only for the purpose of uploading firmware
to the device.

HDMI
-----

The Control Hub lacks a display of its own even though it is a fully-fledged
The Control Hub lacks a display of its own even though it is an
Android device. The Control Hub has an HDMI port that provides video output for
the device; this HDMI port can be used to connect to an external display.

MICRO SD
--------

This is a port for a Micro SD memory card. It is not normally used.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ Battery Ports
**Never** connect a battery charger directly to the battery port. This will
void your warranty and fry your hub.

These `XT-30 <https://docs.revrobotics.com/duo-control/control-system-overview/cables-and-connectors/xt-30-power-cable>`_
The yellow `XT30 <https://docs.revrobotics.com/duo-control/control-system-overview/cables-and-connectors/xt-30-power-cable>`_
connectors are used to power your REV Hub as well as all the devices connected to it.
As the connector is known for its fragility it is highly recommended you be careful when using it.
It is also recommended that you expand your connector prongs periodically. For more information on this
process please watch this `video <https://www.youtube.com/watch?v=UYXTiSeVmB0>`_. While this video features an XT60, a larger version
of the XT-30, and a drone the advice is much the same. This port may also be used
to connect a grounding strap. For more information on legal grounding straps see ``<RE15>``,
:ref:`Game Manual Part 1 <manuals/game_manuals/game_manuals:game manuals>`. For more information on this port please see
For more information on these ports please see the
`REV Documentation <https://docs.revrobotics.com/duo-control/control-system-overview/control-hub-basics#input-power-specifications>`_.
One of these ports may also be used to connect a grounding strap. For more information on legal grounding straps see
the Power Distribution section of the `Competition Manual <https://ftc-resources.firstinspires.org/file/ftc/game/manual>`_.

As the XT30 connector is known for its fragility it is highly recommended you be careful when using it.
It is also recommended that you expand your connector prongs periodically.
REV has a `troubleshooting article <https://docs.revrobotics.com/duo-control/troubleshooting-the-control-system/control-hub-troubleshooting#xt30-pins-are-compressed>`_
specific to expanding the pins on the XT30 connector.
For more information on this process please watch this `YouTube video <https://www.youtube.com/watch?v=UYXTiSeVmB0>`_.
While this video features an XT60 connector, a larger version of the XT30, and a drone, the advice is much the same.

Motor Ports
-------------
Expand Down Expand Up @@ -45,19 +49,20 @@ Servo Ports

These 0.1” Header pins are used to power and control your servos. There are 6 ports on each hub and they are numbered from 0-5.
Be mindful of matching the polarity of the device attached to this port as it is possible to flip the connector.
For increasing the power supplied to these servos it is possible to use a Servo Power Module that is in compliance with
``<RE05>``, :ref:`Game Manual Part 1 <manuals/game_manuals/game_manuals:game manuals>`. For more information on this port
For increasing the power supplied to these servos it is possible to use a Servo Power Module.
See the Motors & Actuators section of the `Competition Manual <https://ftc-resources.firstinspires.org/file/ftc/game/manual>`_ for approved servo power devices.
For more information on this port
please see `REV Servo Port Documentation <https://docs.revrobotics.com/duo-control/control-system-overview/control-hub-basics#servo-port-specifications>`_.

+5V Power Ports
---------------

These 0.1” Header pins are used to power and control various appliances. There
are two ports on each hub. These connectors can be used for a limited range of
applications in FIRST Tech Challenge, such as powering powered USB hubs. For more
applications in *FIRST* Tech Challenge, such as powering powered USB hubs. For more
information on this port please see
`REV +5V Power Port Documentation <https://docs.revrobotics.com/duo-control/control-system-overview/control-hub-basics#id-5v-power-port-specifications>`_ and
:ref:`Game Manual Part 1 <manuals/game_manuals/game_manuals:game manuals>`.
the Power Distribution section of the `Competition Manual <https://ftc-resources.firstinspires.org/file/ftc/game/manual>`_.

Analog Ports
--------------
Expand Down Expand Up @@ -87,8 +92,8 @@ I2C Ports

These 4-pin `JST-PH <https://docs.revrobotics.com/duo-control/control-system-overview/cables-and-connectors/jst-ph-sensors-and-rs485>`_
style connectors are used for connecting I2C sensors. Each port is a single I2C bus where multiple sensors can be
attached. Using sensors with identical addresses on the same bus can cause problems. The range of I2C sensors that can be connected is limited
by :ref:`Game Manual Part 1 <manuals/game_manuals/game_manuals:game manuals>`. While it is possible to use a large range of
attached. Using sensors with identical addresses on the same bus can cause problems.
While it is possible to use a large range of
sensors, the vast majority of I2C sensors do not have drivers built into the SDK. It is possible to use community drivers
or create your own. For more information on this port please see
`REV I2C Port Documentation <https://docs.revrobotics.com/duo-control/control-system-overview/control-hub-basics#i2c-port-specifications>`_.
Expand All @@ -106,5 +111,5 @@ UART
-----

This connector is used only for **Developer** (non end user) debugging. Its use is not supported
by FIRST.
by *FIRST*.

62 changes: 19 additions & 43 deletions docs/source/control_hard_compon/rc_components/uvc/uvc.rst
Original file line number Diff line number Diff line change
@@ -1,56 +1,32 @@
UVC Webcam
===========

.. grid:: 1 2 2 2
:gutter: 2

.. grid-item-card::
:class-header: sd-bg-dark font-weight-bold sd-text-white
:class-body: sd-text-left body

Logitech C270

^^^

.. figure:: images/C270.jpg
:align: center
:width: 50 %
:alt: C270

+++

Logitech C270

.. grid-item-card::
:class-header: sd-bg-dark font-weight-bold sd-text-white
:class-body: sd-text-left body

Logitech C920
A webcam is a device that provides visual images of the surrounding
environment. For use as part of *FIRST* Tech Challenge teams must use a commercially available off-the-shelf (COTS)
USB Video Class `(UVC) <https://www.usb.org/document-library/video-class-v15-document-set>`_
compatible camera. This device can be connected directly to
the REV Control Hub or to the Robot Control system via a USB hub.

^^^
.. figure:: images/C270.jpg
:width: 25%
:class: no-scaled-link
:alt: Example UVC camera

Logitech C270 Webcam

.. figure:: images/C920.jpg
:align: center
:width: 50 %
:alt: C920

+++
Webcams are intended to be used in computer vision related tasks.
Example use cases for a webcam are:

Logitech C920

A webcam is a device that provides visual images of the surrounding
environment. For use as part of *FIRST* Tech Challenge teams must use a COTS
`UVC <https://www.usb.org/document-library/video-class-v15-document-set>`_
(USB Video Class) Compatible Camera. This device can be connected directly to
the REV Control Hub or to the Robot Control system via a powered USB hub
``<RE14>``. This device is intended to be used in vision related tasks. An
example use case of a webcam is reading the state of the barcode after
randomization, a vision task in *Freight Frenzy*, 2021-2022.
- :doc:`detecting <../../../apriltag/understanding_apriltag_detection_values/understanding-apriltag-detection-values>` an AprilTag,
- determining where the robot is :doc:`located <../../../apriltag/vision_portal/apriltag_localization/apriltag-localization>` on the field,
- using OpenCV to :doc:`detect colors or shapes <../../../color_processing/index>` of game elements.

Additional Resources
--------------------

- A :doc:`list of webcams <../../../apriltag/vision_portal/visionportal_webcams/visionportal-webcams>` known to be compatible with VisionPortal.
- :ref:`Connecting UVC Camera via Powered USB Hub <hardware_and_software_configuration/configuring/configuring_uvc_camera/configuring-uvc-camera:configuring an external uvc camera and a powered usb hub>`
- :ref:`Connecting UVC Camera directly to REV Control Hub <hardware_and_software_configuration/configuring/configuring_external_webcam/configuring-external-webcam:configuring an external webcam with a control hub>`
- :ref:`USB Port Overview <control_hard_compon/rc_components/hub/ports/ch-ports:USB-A Ports>`
- :ref:`USB Port Overview <control_hard_compon/rc_components/hub/ports/ch-ports:USB Ports>`
- :ref:`Vision in FIRST Tech Challenge <programming_resources/index:vision programming>`

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Type of External Camera
-----------------------

Theoretically, any USB Video Class (UVC) camera should work with the
system. However, FIRST recommends using UVC web cameras from Logitech.
system. However, *FIRST* recommends using UVC web cameras from Logitech.
The following cameras have been tested and calibrated to work accurately
with SDK software:

Expand All @@ -39,11 +39,22 @@ for an online copy of the file).
Connecting the Camera
---------------------

The UVC camera plugs directly into the USB 2.0 port on the REV Control
The UVC camera can plug directly into the USB 3.0 port on the REV Control
Hub. Unlike the REV Expansion Hub, there is no need for an external
powered USB hub.

.. image:: images/USB-camera-Control-Hub.jpg
:alt: Control Hub with UVC camera connected.

.. warning:: An ESD event on the USB 2.0 port on the Control Hub can cause Wi-Fi disconnects.

The REV Control Hub has a
`known ESD issue <https://docs.revrobotics.com/duo-control/troubleshooting-the-control-system/troubleshooting-the-control-system#esd-mitigation-techniques>`_
with devices plugged into the USB 2.0 port.
Using the USB 2.0 Port may cause ESD to affect your Control Hub's Wi-Fi Chip (causing Wi-Fi disconnects with the driver hub).
Ensure that you plug USB devices, such as a Camera, into the USB 3.0 Port on your Control Hub.

If you wish to connect two webcams see `Cameras and USB Hubs`_.

Camera Configuration
--------------------
Expand All @@ -58,6 +69,7 @@ activity should detect the webcam and give it a default name of “Webcam
1”.

.. image:: images/webcam-config-CH.jpg
:alt: Screen shot showing the Scan button circled in yellow and the resulting USB device listed as Webcam 1.

You can keep this default name (the sample Op Modes reference this name)
or change it. If you change the webcam name, make sure your Op Modes
Expand Down Expand Up @@ -95,12 +107,14 @@ at this time, during which the game pads and START button are disabled
for safety.

.. image:: images/DS-webcam-preview-CH-1.jpg
:alt: Driver Station screen shot showing the menu with the Camera Stream option circled in yellow.

The camera image will appear on the DRIVER STATION screen. Manually
touch the image to refresh it. To preserve bandwidth, only one frame is
sent at a time.

.. image:: images/DS-webcam-preview-CH-2.jpg
:alt: Driver Station screen shot showing the camera image.

This option may be used to adjust the camera, with frequent manual image
refreshing as needed. When finished, open the main menu and select
Expand All @@ -109,18 +123,19 @@ close, the game pads will be enabled, and the START button may be
pressed to continue running the Op Mode.

.. image:: images/DS-webcam-preview-CH-3.jpg
:alt: Driver Station screen shot showing the menu with the Camera Stream option circled in yellow.

**Important Note:** Because the Camera Stream feature is only available
during the INIT phase of an Op Mode, you must ensure that the VisionPortal
is activated in your Op Mode **before** the waitForStart command:

.. image:: images/activateBeforeWaitForStart.png
:alt: The init code for the webcam must be called before waitForStart.
:alt: Blocks code showing the INIT code for the webcam is called before wait for start.

If you do not see the Camera Stream option in your main menu on your
DRIVER STATION, then verify that the VisionPortal is activated
before the waitForStart command in your Op Mode. Also make sure you’ve
given the system enough time to initialize the Vuforia software before
given the system enough time to initialize the VisionPortal software before
you check to see if Camera Stream is available.

Scrcpy
Expand All @@ -129,14 +144,14 @@ Scrcpy
To view the camera output from a computer while an OpMode is running, you
can use `scrcpy <https://github.com/Genymobile/scrcpy>`__. To do this,
you will first need to obtain an ADB connection with your Control Hub.
This can be done by connecting a USB-A - USB-C cable to the USB-C port
This can be done by connecting a USB-A to USB-C cable to the USB-C port
on your Control Hub. If on Windows, you may also connect to your Control
Hub WiFi network and open the `REV Hardware Client <https://docs.revrobotics.com/rev-hardware-client/gs/install>`__.
Once connected, use `these instructions <https://github.com/Genymobile/scrcpy?tab=readme-ov-file#get-the-app>`__
to install and run scrcpy on your computer.

.. image:: images/webcamWithScrcpy.jpg
:alt: The camera output viewed with scrcpy.
:alt: Screen shot showing the camera output viewed with scrcpy.

**Important Note:** While scrcpy is a great way to view the camera output
outside of competitions, the Competition Manual does not allow teams to
Expand All @@ -150,6 +165,7 @@ Alternatively, camera output can be viewed on a display monitor or other
device plugged into the HDMI port on the REV Control Hub.

.. image:: images/HDMIMonitor.jpg
:alt: Photo showing an external HDMI monitor displaying the camera output from a connected control hub.

**Important Note:** While a portable display monitor can be used to view
or troubleshoot the camera stream on your Control Hub, teams are not
Expand All @@ -166,3 +182,56 @@ For custom streams, advanced users of Android Studio may consult the
and
`CameraStreamSource <https://javadoc.io/doc/org.firstinspires.ftc/RobotCore/latest/org/firstinspires/ftc/robotcore/external/stream/CameraStreamSource.html>`__
classes.

Cameras and USB Hubs
^^^^^^^^^^^^^^^^^^^^

You can already connect a UVC webcam into the USB 3.0 port of a Control Hub.
But what if you want to use two webcams?
Perhaps you want the robot to be able to look forward and/or behind without having to spin the robot.
In order to use two webcams on the Control Hub's USB 3.0 port you can add a USB Hub.
This avoid the ESD issue with devices on the USB 2.0 port.

.. note:: If you're using two standard UVC webcams you are not required to use a powered USB hub.

Another use case for a USB hub is if you have a `Limelight 3A <https://limelightvision.io/products/limelight-3a>`_ camera.
This device has its own processor on board and one drawback of this is that the camera always draws power, even when an opMode is not running.
By adding a powered USB hub the Limelight will not drain your robot's battery.

One suitable powered USB hub is the Acer ODK350 5-IN-1 USB 3.0 Hub.
It provides USB 3.0 data speeds to all ports and it has a USB C port that can supply power to all connected devices.

.. note:: At the time this was written, the Acer ODK350 hub was not listed on Acer's website, but was available on Amazon's website.

Not all USB hubs are powered hubs.
Typically, you can't just plug a power bank into any of the USB hub's ports. It must be a port that is designed to supply power.
So if you looking for a powered USB hub there should be a note in the specifications something like the following:
*Note: This USB C port (with IN 5V printed) can not be used for data transfer and charge other devices. It can only supply power for the other 4 USB ports.*

.. figure:: images/two-webcams.jpg
:alt: A USB hub with two webcams is connected to a REV Control Hub.

Acer ODK350 USB hub

The USB Hub is connected to the USB 3.0 port of the Control Hub.
A powerbank is connected to the USB C port on the USB hub to supply power to the connected devices.
Two Logitech 920 webcams are connected to the USB hub.

See the `AprilTag Switchable Cameras <https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTagSwitchableCameras.java>`_ sample program that demonstrates swapping between the two cameras to detect AprilTags.

The other use case is using a Limelight a with a powered USB hub to reduce robot battery drain.
This example shows both a Limelight and a webcam.

.. figure:: images/webcam-and-limelight-3a.jpg
:alt: A USB hub with a webcam and a Limelight 3A connected to a REV Control Hub.

Acer ODK350 USB hub

The USB Hub is connected to the USB 3.0 port of the Control Hub.
A powerbank is connected to the USB C port on the USB hub to supply power to the connected devices.
A Logitech 270 webcam and a Limelight 3A are connected to the USB hub.

The Limelight 3A is not a compatible VisionPortal device. So you can't use the AprilTag switchable camera sample code.
But you can still get results from either the Limelight and/or the VisionPortal webcam and use them as required.


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading