# Welcome

<div data-full-width="false"><figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-1a7b912f0512a21d10d7cf5609e59ab1d9382cf1%2FREV5_simple_crop.png?alt=media" alt=""><figcaption></figcaption></figure></div>

Welcome to the melonbotics docs. Here you will find product information and tips on how to get the most out of your robot.

{% hint style="info" %}
Can't find something? Reach out to me on discord `jaack.w` or via email `melonbotics@gmail.com`\
\
I'm happy to help.
{% endhint %}


# Through Bore Encoder

Product Information for melonbotics Encoder

<div data-full-width="false"><figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-78c1fb84d936eab472b84f03839aae4ce874f3c5%2FIMG-8624.jpg?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

## Product Overview

* 7mm Hex Bore (Compatible with 8mm REX™)
* 1024CPR quadrature output resolution on 4-Pin JST
* Absolute analog position output on 3-Pin JST
* Optimized for 8mm build patterns
* Durable SLS Nylon construction

## CAD Download

{% file src="/files/l8JpkVEftqQxSrr87ETC" %}

## Mechanical Dimensions

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-cbb4588e0015140ac9fc93a6fb60b2e410a812e4%2FMelonbotics_Encoder_Drawing.png?alt=media" alt=""><figcaption></figcaption></figure>


# How to use analog output

The melonbotics Encoder offers analog absolute output on the 3-Pin JST port.

## Specs

* Maximum angle error of ±1.0° (Integral Non-Linearity)
* 12-Bit DAC
* 5us Propagation Delay
* Output Range 0V -> 3.2V (when used on at 3.3V)

## Wiring

#### Method 1 (Recommended)

Use the [JST Joiner Board](https://www.melonbotics.com/products/jst-joiner-board) to connect two Encoders to one Control Hub analog port.

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-0cde8c4d7a4a5044b5ace7fb6e745de01d6643c8%2FIMG-8611.jpg?alt=media" alt="" width="188"><figcaption></figcaption></figure>

#### Method 2 **(Not Recommended)**

Splice the included 3-Pin cable, with the included 4-Pin cable to create an adapter. See below diagram for connector pinouts.

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-e4082b6ac5a857e5237f0ff89278da96390f4299%2FEncoder%20pinout.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

## Code Example

```java
// Get analog port instance from hardwareMap
AnalogInput encoder = hardwareMap.get(AnalogInput.class, "encoder");

// Simple position return
double position = encoder.getVoltage() / 3.2 * 360;

// Position return with adjustable offset
// Offset must be positive, otherwise the modulo (%) operation breaks
//
// If you want to use a negative offset, just add some multiple of 360 so
// that the offset evaluates to be positive.
double offset = -123.4 + 360;
double offsetPosition = (encoder.getVoltage() / 3.2 * 360 + offset) % 360;
```


# Super Servo Plus

Product Information for melonbotics Super Servo Plus

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-63997d3160a7509cbeabc7f04831a81fdde815d0%2FIMG_9951.jpg?alt=media" alt="" width="375"><figcaption></figcaption></figure>

The melonbotics Super Servo Plus is a high performance continous rotation servo, perfectly suited for applications where a high rotation speed is needed with minimal weight. This is **the** servo to use for lightweight and fast intakes and outakes.

The optional mounting plate, selectable at checkout, allows effortless mounting of the Super Servo to 8mm pitch build systems.

## Product Overview

* High speed, continuous rotation servo
* Power Output 6W @ 6V
* Free Speed 1000RPM (0.01 sec/60°)
* Stall Torque 2.3 kgf·cm
* Stall Current 3.9A
* Free Current 0.16A
* Weight 90g

## CAD Download

{% file src="/files/NM6P6iIMJ2zZYk0pOaxU" %}
Just the Servo
{% endfile %}

{% file src="/files/iBK4S6pfwIuswSisNyse" %}
Servo with Mounting Plate
{% endfile %}


# Usage Ideas

## Active Sample Intake

Super Servo for the top set of flaps, and the bottom set of flaps. Each at 1.4:1 reduction.

{% embed url="<https://youtu.be/9uFCzE7VjfU>" %}

## Flap Intake for Into the Deep

In this test

* Super Servo Plus at 1:1 gear ratio
* Flexible rubber flaps

{% embed url="<https://youtube.com/shorts/NRRrh-V9IiE?feature=share>" %}


# Motor Graph

The Super Servo Plus exhibits some behavior you might be unfamiliar with. It's controller is current limited to protect the servo bus, and keep currents over the PWM cables reasonable.

The natural stall current of the motor used in the Super Servo Plus is \~4.7A, while it is capped to \~3.9A of servo bus draw.

{% hint style="info" %}
To get the most out of your Super Servo Plus while having maintaining an efficient robot servo bus, aim to gear so it operates in the third quadrant of the motor graph (i.e. 450RPM-700RPM).\
\
You'll get better efficiency, while still getting max power out of your Super Servo. Your battery will thank you.
{% endhint %}

{% hint style="info" %}
To gauge where on the below graph your super servo is operating in your design, there are two possible ways.

* Use an encoder and measure rotation speed (make sure to account for any ratio's you might have between the Super Servo and your mechanism).
* Place a PWM extension cable between your Super Servo and your robot wiring. Cut the positive 6V wire, and reconnect them via a multimeter in current measurement mode. Then simply compare the measured current to the current on the below graph.<br>
  {% endhint %}

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-5698dbc70a9ed8dde8fbb8ac281e8308bfe0f8c6%2FSuperServoPlus%20Graph.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


# Nano Encoder

Setup, wiring, and magnet mounting guide for the melonbotics Nano Encoder

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-c64d49dd2658e21df522110a22f2f9ea5d8062df%2FDSC08830.jpg?alt=media" alt="Front and rear views of the melonbotics Nano Encoder" width="375"><figcaption><p>Component side (left) and rear side (right).</p></figcaption></figure>

The melonbotics Nano Encoder is a compact magnetic encoder for measuring the absolute angle of a rotating mechanism. It provides a 0°-360° analog position signal through a 3-pin JST-PH connector, so the mechanism's position is available immediately after power-up without first counting from a home position.

## Product Overview

* Absolute 0°-360° position sensing
* 12-bit ratiometric analog output on a 3-pin JST-PH connector
* Contactless sensing using a diametrically magnetized magnet
* Green power indicator LED
* Compact PCB with three mounting holes

{% hint style="info" %}
The green LED only indicates that the Nano Encoder is receiving power. It is a useful first check if the encoder is not responding, but it does not indicate that a magnet has been detected or that the analog signal is valid.
{% endhint %}

## What's Included

A Nano Encoder 2-Pack includes:

* 2x Nano Encoder
* 2x 6 mm x 2.5 mm diametrically magnetized neodymium magnets
* 2x 3-pin JST-PH cable
* 1x 4-pin JST-PH cable
* 1x Analog JST Joiner Board

## Quick Start

1. Secure the Nano Encoder so that its sensing centre is aligned with the rotating shaft.
2. Attach one of the included magnets to the rotating part, with the flat face of the magnet parallel to the PCB.
3. Centre the magnet's rotation axis over the sensor. On the rear of the REV4 board shown above, the white dot marks the sensing centre.
4. Connect the Nano Encoder to an Analog JST Joiner Board with a 3-pin cable, then connect the Joiner Board to a Control Hub or Expansion Hub analog port with the 4-pin cable.
5. Power the robot and confirm that the green LED illuminates.
6. Configure the corresponding channel as an **Analog Input**, then rotate the magnet through one complete revolution and verify that the reported voltage changes smoothly and wraps once.

See [How to use analog output](/through-bore-encoder/how-to-use-analog-output) for FTC wiring, configuration, and Java examples.

## Magnet Selection and Mounting

The Nano Encoder requires a **diametrically magnetized** cylindrical magnet. An axially magnetized magnet will not produce the rotating magnetic field required for angle sensing.

The included 6 mm diameter x 2.5 mm thick magnet matches the recommendation in the MT6701 sensor datasheet.

### Alignment

For the best accuracy:

* Keep the magnet face parallel to the PCB.
* Align the magnet's rotation axis with the sensor's sensing centre.
* Keep off-axis misalignment to 0.3 mm or less.
* Confirm that the reading changes smoothly through the full 360° rotation before permanently fixing the magnet in place.

### Sensing from the component side

When the magnet faces the sensor package directly, the MT6701 datasheet specifies a distance of 0.5-2.0 mm between the magnet and the surface of the sensor IC, with 1.0 mm typical.

{% hint style="info" %}
The datasheet spacing is measured to the **surface of the sensor IC**, not to the surface of the PCB.
{% endhint %}

### Sensing through the PCB

The Nano Encoder can also sense a magnet from the rear of the board. The PCB thickness becomes part of the total distance between the magnet and sensor, so place the magnet as close to the rear surface as practical. A rear-surface gap of **0.5 mm or less** is recommended for reliable operation.

Backside sensing is more sensitive to magnet strength, alignment, and the exact mechanical stack-up. Test the complete mechanism through a full revolution before final assembly.

## Connector and Wiring

The connector and rear test pads are labelled:

| Label   | Function                        |
| ------- | ------------------------------- |
| `GND`   | Ground                          |
| `VCC`   | Sensor power                    |
| `A_OUT` | Absolute analog position output |

Use the supplied cables and Analog JST Joiner Board when connecting to a REV Control Hub or Expansion Hub. Each physical Hub analog connector contains two independent analog channels; make sure the channel selected in the Robot Configuration matches the Joiner Board socket used by the Nano Encoder.

## Technical Specifications

| Specification                 | Value                                               |
| ----------------------------- | --------------------------------------------------- |
| Sensing range                 | 0°-360° absolute                                    |
| Output                        | Ratiometric analog                                  |
| Analog resolution             | 12-bit DAC                                          |
| Sensor supply range           | 3.0-5.5 V                                           |
| Integral non-linearity        | ±1.0° typical, ±1.5° maximum                        |
| Propagation delay             | 5 µs typical                                        |
| Recommended magnet            | 6 mm diameter x 2.5 mm, diametrically magnetized    |
| Component-side magnet gap     | 0.5-2.0 mm to the sensor IC surface; 1.0 mm typical |
| Maximum off-axis misalignment | 0.3 mm                                              |

The magnetic and sensor figures above are taken from the MT6701 datasheet. Actual system accuracy also depends on magnet strength, alignment, spacing, mounting rigidity, and analog calibration.

## Troubleshooting

| Symptom                                          | Checks                                                                                                                                       |
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Green LED is off                                 | Check that the cable is fully seated, the Joiner Board is connected to the Hub, and the robot is powered.                                    |
| Green LED is on, but the voltage does not change | Confirm that the correct analog channel is configured, the magnet is diametrically magnetized, and it is centred close enough to the sensor. |
| Reading jumps or has a dead region               | Reduce the magnet gap, improve axial alignment, and check that the magnet cannot move or tilt.                                               |
| Angle moves in the opposite direction            | Invert the angle in software to match the mechanism's coordinate convention.                                                                 |
| Zero position does not match the mechanism       | Apply a software offset after installing the encoder and magnet.                                                                             |

## CAD Download

{% file src="/files/PGPFjZZhNcd1g69Z82j4" %}

## Sensor Reference

[MT6701 datasheet, Rev. 1.8 (PDF)](https://www.magntek.com.cn/upload/pdf/202407/MT6701_Rev.1.8.pdf)


# Barecoder Micro

Product information for melonbotics Barecoder Micro

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-3c0cc0bbdbfd4a3d6496c3d82674f865f93b6c78%2FIMG-0356.jpg?alt=media" alt="" width="375"><figcaption></figcaption></figure>

## Product Overview

* Super compact magnetic encoder board
* 1024CPR quadrature output resolution on 4-Pin JST
* Absolute analog position output on 3-Pin JST

## CAD Download

{% file src="/files/qSPJSt2uHB1t04XKFrjP" %}

## Magnet Mounting Directions

The included magnet should be positioned within 1.5mm-3mm from the top of the PCB. Sensing from the backside, through the PCB is possible, however is at your own risk. If done, the magnet needs to be <0.5mm from the back of the PCB to ensure sensor operation.

## Absolute Output

[How to use analog output](/through-bore-encoder/how-to-use-analog-output)


# Super Servo (Discontinued)

Archive of specs for original Super Servo

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-5a62bfda0f71f9d9ebdce25d2458b82366fdc81e%2Fimage_6ec93b25-6c3e-484d-a9c6-5954376e6608.jpg?alt=media" alt="" width="375"><figcaption></figcaption></figure>

## **Features**

* Compact motor with integrated gearbox
* 4mm D-shaft
* 3-wire servo interface
* 10W max power draw
* Continuous rotation only

## **Specifications**

* Stall Current 1.7A
* Free Current 0.18A
* Stall torque (continuous) 0.6kg•cm
* Stall torque (peak) 1.3kg•cm

Peak stall torque is provided at startup. If a stall condition continues to occur, the controller will taper the torque output linearly until it reaches 0.6kg•cm over a period of 45 seconds.

This is to thermally protect the controller and motor, and to maintain compliance with the REV Hub’s 2A per servo channel limit.


# Stagelite

<figure><img src="https://1580331926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnHZmDkFp5cOUYczo9V98%2Fuploads%2Fgit-blob-f7090f28b5cd0a2044f7339f93fb86ef6c60c89b%2FIMG-0342.jpg?alt=media" alt="" width="375"><figcaption></figcaption></figure>

LED board to suit Limelight 3A. Controllable via control hub digital port, to prevent distracting illumination.

* Input Voltage 5V
* Current Draw 0.45A
* Controllable via ENABLE pin. Pull low to disable light, leave floating/pull high to enable.

## Wiring Guide

Can be connected to control hub "5V" port, to supply 5V power.

If you wish to illuminate always, only wire the +5V and GND pins. If the EN pin is left disconnected the light will be on.

If you wish to control the light in code, connect the EN line to a digital port, and set it high when you want the light to illuminate, and low when you wish it to disable.


