# 关节校准

{% hint style="info" %}
关节校准对于机器人正常工作至关重要。
{% endhint %}

预组装的机器人应该已安装腿部组件，但您可以通过微调关节的校准参数来进一步提高其性能。&#x20;

校准前请确保您已上传 OpenCat [主功能固件](https://docs.petoi.com/v/chinese/arduino-ide/wei-nyboard-shang-chuan-cheng-xu#10.-shang-chuan-zhu-yao-gong-neng-cheng-xu)。

{% hint style="info" %}
我们已在网上发布了Bittle/Bittle X的校准支架3D打印结构件。如果你有3D打印机，你可以自己打印。\
请查看此页面：<https://github.com/PetoiCamp/NonCodeFiles/blob/master/stl/BittleStand/standWithCalibration.stl\\>
\ <img src="/files/pajpSRg71XL211kMHmT4" alt="" data-size="original">
{% endhint %}

## \*关节校准背后的逻辑是：

1. 在舵机通电和校准之前，您不知道它们上电后会指向哪里。 因此，如果您连接腿，腿将旋转到随机角度，并可能与机器人的身体或其他腿碰撞并被卡住。 如果舵机长时间卡住，则可能会损坏。
2. 该机器人有一种称为“校准”的姿势，所有关节均设置为 0 度。 您可以设置机器人[进入校准姿势状态](https://docs.petoi.com/v/chinese/guan-jie-xiao-zhun#jin-ru-guan-jie-xiao-zhun-zhuang-tai)，以便您知道所有关节都应该旋转到零度点（尽管您看不到，因为腿尚未连接到舵机输出轴的齿轮上）。 然后，您可以将身体组件逐个关节地连接到舵机输出轴的齿轮上，尽量保持相互垂直的关系（大腿与躯干垂直，小腿与大腿垂直，颈部安装时尽量保持头部正对正前方），如下图所示。<br>

   <figure><img src="/files/4izzX1GC4CepgbuMYR2V" alt=""><figcaption><p>校准姿势</p></figcaption></figure>
3. 由于舵机输出轴的齿轮齿是离散的，因此不可能将支腿完美地对齐到直角。 因此，您需要在软件中微调偏移。<br>

   <figure><img src="/files/3afZXUC71mU94r9lyvQg" alt=""><figcaption></figcaption></figure>

Nybble 和 Bittle 的关节校准原理是相同的。

## 准备进入关节校准状态

进入校准状态需要做好以下几项准备工作： ‌

1. 将所有舵机线连接至主板
2. 将电池连接至主板并开机（长按电池上的按钮可打开/关闭电源）
3. 使用USB 适配器或蓝牙模块连接机器人与电脑或手机。

{% hint style="info" %}
如果您使用未组装的套件搭建机器人，请不要在进入校准状态之前安装头部和腿部组件。
{% endhint %}

## 进入关节校准状态

机器人的腿在启动时可能会指向未知的角度。 当进入校准状态时，关节将转动到零度位置。 您可以看到舵机输出轴上的齿轮旋转然后停止。 然后您可以连接腿部组件并在软件界面中微调关节偏转。 通过使用软件，有3种方式可以进入校准状态并对关节进行微调。

* 使用[移动应用 Petoi](https://docs.petoi.com/v/chinese/shou-ji-ying-yong/xiao-zhun-yu-kong-zhi)
* 使用 [Petoi 桌面应用程序](https://docs.petoi.com/v/chinese/zhuo-mian-ying-yong/guan-jie-xiao-zhun)
* 使用 [Arduino IDE](https://docs.petoi.com/v/chinese/arduino-ide/shi-yong-arduino-ide-xiao-zhun)

{% hint style="info" %}
您也可以通过保持侧立姿势启动机器人来进入校准状态。 这种方法不需要任何计算机、遥控器或者手机App。因此当您专注于从套件中组装机器人，手头没有计算机、遥控器或者手机App时，可以粗略校准关节舵机。

![](/files/JLfp4CmGIYFXuMRA3mQw)
{% endhint %}

## 安装螺钉

完成关节校准后，安装中心螺钉，固定所有关节部件和舵机齿轮。

<figure><img src="/files/u8hxR3ach11RPdq8j4uv" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/vdDYmveLBCAUdd1ABXdj" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.petoi.com/chinese/guan-jie-jiao-zhun.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
