> For the complete documentation index, see [llms.txt](https://guide.petoi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.petoi.com/product/nybble-q/control-and-program/petoi-desktop-app/joint-calibrator.md).

# Joint Calibrator

Robots can be precisely calibrated using the Petoi Desktop App.

Please refer to [the introduction](/product/nybble-q/control-and-program/petoi-desktop-app.md) for installing the Petoi Desktop App and connecting the robot to your computer.

## The rationale for calibration

### Understand the zero state and the coordinate system

After [entering the calibration state](#enter-the-calibration-state), with all servos rotated to their zero angles, attach the head, tail, and legs prepared in the previous section to the body. They are generally perpendicular to their linked body frames. The calibration pose is shown below:

![Nybble's Calibration State](https://4130507397-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXLpFdG7mubqEHWylLK3w%2Fuploads%2FbZXWXne7AN41v5l9efnT%2F2041749632995_.pic_hd_en.png?alt=media\&token=33e21fda-a3cd-4ba8-9fb0-581e385a28e5)

Install the servo-related components according to the picture above and try to ensure that they are perpendicular to each other (the upper leg is perpendicular to the torso, and the lower leg is perpendicular to the upper leg).&#x20;

{% hint style="warning" %}
Note: Insert the servo-related components directly into the servo output shaft; do not turn the output shaft during this process.
{% endhint %}

Rotating the limbs counterclockwise from their zero states will be positive (the same as in polar coordinates). Viewed from the left side of the robot's body, the counter-clockwise rotation of the joint is defined as the positive direction.

{% hint style="info" %}
The only exception is the head tilt angle for Nybble. It’s more natural to say head up, while it’s the result of rotating clockwise.&#x20;
{% endhint %}

{% hint style="info" %}
However, from the right side of the robot's body, the rotation directions' positive and negative are just opposite.
{% endhint %}

### Discrete angular intervals

If we look closer at the servo shaft, we can see it has a certain number of teeth. That’s for attaching the servo arms and avoiding sliding in the rotational direction. In our servo sample, the gears divide 360 degrees into 25 sectors, each taking **14.4** degrees(offset of -7.2\~7.2 degrees). That means we cannot always get a perfect perpendicular installation.&#x20;

![](https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/Wfe4GJdraHoRxzyvxmLH/assets_bittle_-MTLzoDqllmeUcpCu5jV_-MTM-Wiv6R3xuNmAhgrE_37.png)

## Calibration process

### Enter the calibration state

{% hint style="info" %}
Connect the battery to the mainboard, then long-press the battery button for more than 3 seconds to power on the robot.
{% endhint %}

&#x20;After a battery powers on the robot, there are two methods to enter the calibration mode:

* It will automatically enter calibration mode when you click the **Joint Calibrator** button.<br>

  <figure><img src="https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/2TeF41CsDj5Hbofsev1O/image.png" alt=""><figcaption></figcaption></figure>
* Click the **Calibrate** button in the **Joint Calibrator** interface.&#x20;

{% hint style="info" %}
The servo slider is not available in the light yellow background area in the interface.
{% endhint %}

The joint calibration interface for Nybble Q in the Petoi Desktop App is as follows:

<figure><img src="https://4130507397-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXLpFdG7mubqEHWylLK3w%2Fuploads%2FwiSg9oHXTt6wddJDmM4t%2Fimage.png?alt=media&amp;token=39659ff1-c049-4dd6-b4f9-e072bbe80364" alt=""><figcaption><p>The interface for Nybble Q</p></figcaption></figure>

### Fine-tuning

Please use the L-shaped calibration tool included in the package as a calibration reference. According to the joint numbers shown in the picture within the calibration interface, click and drag the corresponding joint sliders or click on the blank areas of the slider tracks to fine-tune the joints to a right angle.

Please note that when calibrating the servos, adjust the upper leg first, then change the lower leg.

![](https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/quPcEFaTXA5a75Yp1T3V/Nybble-L.jpg)

{% hint style="info" %}
If the offset exceeds ±9 degrees, you must remove the corresponding leg and reinstall it by rotating one tooth and then dragging the corresponding slider. For example, if it is adjusted to +9 and still not correct, remove the corresponding leg and shift it one tooth when reattaching it. Then, you should get a smaller offset in the opposite direction.&#x20;
{% endhint %}

### Validation and Save data

<figure><img src="https://4130507397-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXLpFdG7mubqEHWylLK3w%2Fuploads%2FsJwpb7gw20MLlhVYiKtE%2FcalibValidation.png?alt=media&amp;token=a8a6dc53-5d52-4769-93da-2a7d29eee355" alt=""><figcaption><p>Nybble</p></figcaption></figure>

You can switch between  "**Rest**", "**Stand up**" and "**Walk**" to test the calibration effect.&#x20;

If you want to continue calibrating, please click the **Calibration** button, and the robot will be in the calibration state again (all servos will move to the calibration position immediately).&#x20;

{% hint style="warning" %}
Note: You may need a second round of calibrations to achieve optimal results.
{% endhint %}

After calibration, remember to click the "**Save**" button to save the calibration offset. Otherwise, click the "**Abort**" button to abandon the calibration data. You can save the calibration in the middle in case your connection is interrupted.&#x20;

{% hint style="info" %}
When you close this window, there is a message box shown below:

![](https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/jgUfnFpHr6bHkkyjsHrr/image.png)

To save the calibration data, please click the "**Yes**" button; otherwise, click the "**No**" button. Click the "**Cancel**" button to cancel or quit.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.petoi.com/product/nybble-q/control-and-program/petoi-desktop-app/joint-calibrator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
