Only this pageAll pages
Powered by GitBook
1 of 9

MitoCANdria

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Code Examples

Installing Libraries

Java/C++

VS Code

To add a vendor library that has been installed by an offline installer, press Ctrl+Shift+P and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing Manage Vendor Libraries, then select it from the menu. Select the option to Install new libraries (offline).

Select the desired libraries to add to the project by checking the box next to each, then click OK. The JSON file will be copied to the vendordeps folder in the project, adding the library as a dependency to the project.

In order to install a vendor library in online mode, press Ctrl+Shift+P and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing Manage Vendor Libraries and select it in the menu, and then click on Install new libraries (online) instead and copy + paste the vendor JSON URL.

Checking for Updates (Offline)

Since dependencies are version managed on a per-project basis, even when installed offline, you will need to Manage Vendor Libraries and select Check for updates (offline) for each project you wish to update.

Checking for Updates (Online)

Part of the JSON file that vendors may optionally populate is an online update location. If a library has an appropriate location specified, running Check for updates (online) will check if a newer version of the library is available from the remote location.

Configuring with GrappleHook

Overview

Do not plug into other USBs to config, only the one marked “DATA” - note this will not damage the product, it just will not be configurable

USB-C

  • Connect via configuration USB-C port

  • Use configuration app for settings

  • Recommended for most use cases

CAN (via roboRIO)

  • Runs CAN server on roboRIO

  • Note: Cannot run simultaneously with robot code

  • Alternative configuration method when USB is inaccessible

Configuration Features

  • Toggle switchable 5V WAGO rails

  • Adjust boost rail voltage (15-24V range)

  • Monitor current draw and power consumption

  • Update firmware via USB or CAN bootloader

Quick Start

  1. Connect via preferred method (USB-C or CAN)

  2. Launch configuration app

  3. Adjust rail settings as needed

When initially booting GrappleHook, the MitoCANdria will present itself as a "Grapple USB Device" if over USB or through the RoboRIO if connecting over CAN. Click the appropriate option for your use case.

Once selected, you will be prompted to connect.

Once connected, you will be able to see live current as well as be able to enable and disable the 5V rails. You will also be able to adjust the boost rail to meet your needs.

You will also be able to use the GrappleHook app to handle firmware updates.

C++ Example

Coming soon.

Mechanical Info

Here is a link to the OnShape file.

The MitoCANdria has convenient tapped holes for grid tube mounting, as well as zip tie mounts if you want to mount it with a ziptie.

About this Product

Use Cases:

  • Power Distribution for Vision Processing Systems

  • Clean Power Supply for Sensitive Electronics

  • High-Current 5V Rail Distribution

  • Configurable Voltage Boost for Custom Requirements

  • USB Device Power Management

Key Features:

  • Dual-stage power distribution scheme with dual phase boost stage and buck stage for maximum efficiency

  • Input voltage range 3V – 24V

  • Over 10A capability on 5V rail

  • Configurable boost rail (14.5V-24V)

  • USB configuration interface

  • Built-in reverse polarity protection

  • Regulated, clean voltage output

  • Easy-access Wago terminal blocks

  • Locking USB cable support

  • FRC CAN integration

The MitoCANdria lives up to its name as the powerhouse of your robot, providing reliable and clean power distribution where it matters most. Its innovative dual-phase design efficiently converts input voltage to both a robust 5V rail and a configurable boost rail. The system excels at powering sensitive electronics like vision processors that require dependable voltage regulation. With built-in reverse polarity protection and USB configurability, setup is both safe and user-friendly. The convenient Wago terminal blocks for both the boost rail (14.5-24V) and 5V rail make power distribution both accessible and secure. Whether you're powering vision systems, sensors, or other critical electronics, the MitoCANdria delivers the clean, reliable power your robot needs.

Power Consumption and Wiring Guide

The board allows for bursts of 150W, but it is recommended the user draw no more than 100W (current times voltage), with a 10A limit on the 5V rail (50W). In testing, 3 Orange Pis being run in headless mode was enough to fill the 5V rail.

Here is a link to a Load Calculator that calculates the current draw of some common FRC peripherals, with LEDs, Orange Pis, and Limelights. The link is also in the menu bar, and instructions on how to use it are here.

The 5V rail is shown below, and is able to be accessed by the USB connectors (not switchable on/off) and the WAGO ports (switchable):

The boost rail (configurable 15-24V) is only accessible on the lower two WAGO ports.

- is on bottom, as seen below and per the silk text.

Boost Rail Protection

The MitoCANdria's boost rail (configurable 15-24V) features intelligent overvoltage protection. If the rail exceeds its set voltage by 1V, it immediately shuts off. This protection is crucial for defending expensive components like Vision Processors.

For example, if you've configured the boost rail to 15V and a spike pushes it to 16V, the rail automatically disables. This rapid response time protects your investment in sensitive electronics and helps prevent costly replacements.

How To Use Load Calculator

MitoCANdria Load Calculator Guide

Overview

The MitoCANdria Load Calculator is a tool designed to help FRC teams calculate their power requirements across both the 5V rail and Boost rail. The system has a combined continuous rating of 150W that is shared between both rails.

How to Use the Calculator

Step 1: Fill in the 5V Rail Section

Enter the quantity of each component your robot uses that draws power from the 5V rail:

  • LED Count: Number of LEDs being powered

  • Orange Pi Count: Number of Orange Pi boards

  • Limelight Count: Number of Limelight vision systems

  • Other Sensor Count: Enter the number of additional sensors

    • This includes TTB sensors and other FRC Electrical products

    • For simplicity, this uses a standard power estimation

Step 2: Fill in the Boost Rail Section

Enter your boost rail requirements:

  • Voltage: Your required boost voltage

  • Amperage: Current draw needed

  • Wattage: This will be automatically calculated

Step 3: Understanding the Results

The calculator will automatically:

  • Calculate the total power requirements for the 5V rail

  • Show boost rail power consumption

  • Determine the required number of MitoCANdrias based on your power needs

Important Power Limitations

  1. Combined Power Rating: Both the 5V and Boost rails share a 100W continuous power rating

  2. Power Distribution: When planning your power needs, ensure that the combined wattage from both rails doesn't exceed 100W per MitoCANdria

  3. Automatic Scaling: The calculator will automatically determine how many MitoCANdrias you need based on your power requirements

Best Practices

  1. Always round up when estimating component counts

  2. Consider future additions to your robot when planning power requirements

  3. Monitor both rails' power consumption to stay within the 150W continuous rating

Calculator Fields Guide

Green Cells

  • These are automatically calculated - do not modify

  • Includes the MitoCANdria count, which is determined based on your power needs

White Cells

  • These are input fields that you need to fill in

  • Only enter numbers in these cells to ensure accurate calculations

Troubleshooting

If your calculated values seem incorrect:

  1. Verify all white cells contain accurate numbers

  2. Ensure you haven't modified any green (calculated) cells

  3. Check that your boost rail requirements are properly entered

  4. Verify that the combined power draw across both rails makes sense for your application

Support

For additional assistance or questions about the MitoCANdria Load Calculator, please contact:

  • Email: [email protected]

Java Example

Overview

This documentation explains how to use the MitoCANdria Java API to control and monitor your MitoCANdria device. The example demonstrates basic channel operations including reading current/voltage, enabling/disabling channels, and setting voltage levels.

Basic Setup

try (MitoCANdria mito = new MitoCANdria(1)) {
    // Device operations here
}

The MitoCANdria class implements AutoCloseable, allowing use of try-with-resources for automatic resource cleanup. The constructor parameter (1) represents the device ID.

Available Channels

The API provides several predefined channels:

  • MITOCANDRIA_CHANNEL_USB1: USB Port 1

  • MITOCANDRIA_CHANNEL_USB2: USB Port 2

  • MITOCANDRIA_CHANNEL_5VA: 5V Rail A

  • MITOCANDRIA_CHANNEL_5VB: 5V Rail B

  • MITOCANDRIA_CHANNEL_ADJ: Adjustable Voltage Channel

API Operations

1. Reading Current

mito.getChannelCurrent(MitoCANdria.MITOCANDRIA_CHANNEL_USB1)
    .ifPresentOrElse(
        current -> System.out.println("USB1 current: " + current + " A"),
        () -> System.out.println("Couldn't get USB1 current")
    );
  • Uses getChannelCurrent() to read current draw from a channel

  • Returns an Optional containing the current in amperes

  • Uses ifPresentOrElse() for handling both successful and failed readings

2. Reading Voltage

mito.getChannelVoltage(MitoCANdria.MITOCANDRIA_CHANNEL_5VA)
    .ifPresentOrElse(
        voltage -> System.out.println("5VA voltage: " + voltage + " V"),
        () -> System.out.println("Couldn't get 5VA voltage")
    );
  • Uses getChannelVoltage() to read voltage from a channel

  • Returns an Optional containing the voltage in volts

  • Uses ifPresentOrElse() for error handling

3. Enabling/Disabling Channels

mito.setChannelEnabled(MitoCANdria.MITOCANDRIA_CHANNEL_USB2, true);
  • Uses setChannelEnabled() to control channel state

  • Parameters: channel constant, boolean enable state (true = enabled)

4. Setting Voltage

mito.setChannelVoltage(MitoCANdria.MITOCANDRIA_CHANNEL_ADJ, 15);
  • Uses setChannelVoltage() to set voltage on adjustable channels

  • Only works with MITOCANDRIA_CHANNEL_ADJ

  • Second parameter is desired voltage in volts

5. Reading Voltage Setpoint

mito.getChannelVoltageSetpoint(MitoCANdria.MITOCANDRIA_CHANNEL_ADJ)
    .ifPresentOrElse(
        setpoint -> System.out.println("ADJ channel setpoint: " + setpoint + " V"),
        () -> System.out.println("Couldn't get ADJ channel setpoint")
    );
  • Uses getChannelVoltageSetpoint() to read the configured voltage

  • Useful for verifying voltage settings on adjustable channels

6. Checking Channel State

mito.getChannelEnabled(MitoCANdria.MITOCANDRIA_CHANNEL_5VB)
    .ifPresentOrElse(
        enabled -> System.out.println("5VB channel enabled: " + (enabled == 1)),
        () -> System.out.println("Couldn't check if 5VB channel is enabled")
    );
  • Uses getChannelEnabled() to check if a channel is active

  • Returns 1 for enabled, 0 for disabled

Error Handling

The example uses a try-catch block to handle potential exceptions:

try {
    // Device operations
} catch (Exception e) {
    System.out.println("An error occurred: " + e.getMessage());
}

Support

For additional assistance or questions about the MitoCANdria Java API, please contact:

  • Email: [email protected]

Code Block:

public class MitoCANdriaExample {
    public static void main(String[] args) {
        try (MitoCANdria mito = new MitoCANdria(1)) {
            // Get and print USB1 current
            mito.getChannelCurrent(MitoCANdria.MITOCANDRIA_CHANNEL_USB1)
                .ifPresentOrElse(
                    current -> System.out.println("USB1 current: " + current + " A"),
                    () -> System.out.println("Couldn't get USB1 current")
                );

            // Get and print 5VA voltage
            mito.getChannelVoltage(MitoCANdria.MITOCANDRIA_CHANNEL_5VA)
                .ifPresentOrElse(
                    voltage -> System.out.println("5VA voltage: " + voltage + " V"),
                    () -> System.out.println("Couldn't get 5VA voltage")
                );

            // Enable USB2 channel
            mito.setChannelEnabled(MitoCANdria.MITOCANDRIA_CHANNEL_USB2, true);
            System.out.println("USB2 channel enabled");

            // Set ADJ channel voltage
            mito.setChannelVoltage(MitoCANdria.MITOCANDRIA_CHANNEL_ADJ, 3.3);
            System.out.println("ADJ channel voltage set to 3.3V");

            // Get and print ADJ channel setpoint
            mito.getChannelVoltageSetpoint(MitoCANdria.MITOCANDRIA_CHANNEL_ADJ)
                .ifPresentOrElse(
                    setpoint -> System.out.println("ADJ channel setpoint: " + setpoint + " V"),
                    () -> System.out.println("Couldn't get ADJ channel setpoint")
                );

            // Check if 5VB channel is enabled
            mito.getChannelEnabled(MitoCANdria.MITOCANDRIA_CHANNEL_5VB)
                .ifPresentOrElse(
                    enabled -> System.out.println("5VB channel enabled: " + (enabled == 1)),
                    () -> System.out.println("Couldn't check if 5VB channel is enabled")
                );

        } catch (Exception e) {
            System.out.println("An error occurred: " + e.getMessage());
        }
    }
}

LED States

Red (solid) - In Bootloader

Red + Yellow (flashing) - Bootloader Initialised

Red + Purple (flashing) - Detecting CAN bitrate

Green (solid) - Firmware ready, CAN initialised

Green + Purple (flashing) - Firmware ready, CAN awaiting bitrate detection (CAN bus disconnected)