# Bittle 用户手册

李荣仲

## 导读

为使本文档简明易用，此用户手册更多侧重于组装步骤而非原理剖析。如果您对“为什么”更感兴趣，欢迎来我们的论坛<https://www.petoi.com/forum>发帖，或写信给<info@petoi.com>和我们讨论。

![](/files/-Mecze7sj5ihX97al8YZ)

我们已在Indiegogo（[igg.me/at/bittle](https://bittle.petoi.com/zhong-wen/www.igg.me/at/bittle)）上众筹成功并在[官网](https://bittle.petoi.com/zhong-wen/www.petoi.com/store)持续销售Bittle套件，国内淘宝包邮。我们的社交网络（B站/Instagram/推特/脸书/GitHub）帐号&#x4E3A;**@PetoiCamp**，欢迎通过标签 **#bittle #petoi #opencat** 分享您的组装成果或心得，我们会转发的！

{% hint style="info" %}
最近更新: 07/24/2022
{% endhint %}


# 1 🧘‍♂️ 工具和准备

“磨刀不误砍柴工” 🪓

## 1.1 准备工作

将你的桌面清理整洁后打开包装，如果你害怕丢失小零件也可以先拍一张全体零件的照片。

{% hint style="success" %}
强烈建议不要在有地毯或者马赛克地毯的房间组装，一旦小的螺丝或零件掉落你可能无法找回它们了。
{% endhint %}

## 1.2 Tools and accessories 工具和附件

{% tabs %}
{% tab title="必需工具" %}

| **工具**              | 具体规格及要求                                                                                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 平口及十字（PH）螺丝刀        | M2（直径2mm）                                                                                                                                                                |
| Windows/苹果/Linux计算机 | <p>下载 <a href="https://github.com/PetoiCamp/OpenCat/releases">Petoi 桌面应用程序</a></p><p>安装 <a href="https://www.arduino.cc/en/software">Arduino IDE</a></p><p>配备标准USB接口</p> |
| USB充电器              | 最低5V-1A                                                                                                                                                                  |
| {% endtab %}        |                                                                                                                                                                          |

{% tab title="备用" %}

| **工具**                  | **用途**                     |
| ----------------------- | -------------------------- |
| 焊接套件                    | 焊接PCB（非Hacker请在专业人士指导下尝试）  |
| 3D打印机                   | 增加你喜欢的模块                   |
| Arduino/Raspberry Pi 套件 | 给Bittle增加一些奇怪的东西           |
| 数字万用表（模拟的也可以）           | 测试                         |
| 示波器                     | 测试                         |
| 各种胶水                    | 尽量避免使用它们。 Bittle 原本设计无需胶水！ |
| {% endtab %}            |                            |
| {% endtabs %}           |                            |

### 1.3 安装流程简介

安装的总流程如下图所示：

![](/files/-MUf-FKLP7BFfl6urLU_)


# 2 🧩 打开包装

"生活就像一盒还未完成组装的Bittle." 🔍

<figure><img src="/files/cFM51AqSnscQYLc1xWXA" alt=""><figcaption><p>左边是初步组装版本，右边是未组装版本。</p></figcaption></figure>

## 2.1 预组装版本的Bittle

{% embed url="<https://www.bilibili.com/video/BV17M411W7EU/?share_source=copy_web&vd_source=50db22b3f864984d994cc819f4f3557c>" %}

{% hint style="info" %}

#### 安装步骤：

00:12 安装脖子 - 将脖子部件对准接口，轻推至位。

01:28 安装电池 - 打开电池舱门，将电池正确放置并确保接触良好。

02:05 弯曲腿部 - 轻按腿部关节，使其弯曲到预设位置。

03:15 打开后盖 - 找到后盖开关，轻轻拉开后盖。

04:07 插入蓝牙适配器 (仅适用于配有NyBoard的模型) - 找到蓝牙适配器插槽，将适配器插入确保连接。

05:05 连接移动端App
{% endhint %}

如果收到的是预装版本的Bittle，则需要将脖子插入身体并**将膝盖弯曲成自然角度**。将弯曲的舵机线从膝盖侧拉到肩膀侧，以避免在膝盖关节旋转时被挤压到。

![](/files/fDYmn5PfrbtmIeEXPQ9Q)

‌**长按**电池按钮2到3秒钟打开/关闭电源。拔下红外遥控器电池的绝缘片，然后您可以[控制Bittle的移动](https://docs.petoi.com/v/chinese/hong-wai-yao-kong/yao-kong-qi)。如果Bittle检测到电量低会暂停动作并哔哔叫，这时您需要用5V micro-USB线给电池充电。考虑安全因素，充电时不可开机。

![](/files/-MSmyAEyBm8iJJ42uyMK)

**蜂鸣器声音含义：**

| 声音类型 | 场合         | 说明          |
| ---- | ---------- | ----------- |
| 短旋律  | 通电或重启      | 程序启动成功      |
| 短哔声  | 使用过程中      | 程序收到指令      |
| 重复旋律 | 在使用或动作暂停期间 | 电池电量低或未连接电池 |

您可以跳过第 3 章 **配置NyBoard，**&#x7B2C; 4 章 **组装** 和第5章 **连线**。从第6章 [**校准**](https://bittle.petoi.com/v/zhong-wen/6-jiao-zhun) 开始继续阅读本手册。

{% hint style="warning" %}
**预组装的Bittle仅经过粗校准**。 您仍然需要仔细校准其关节舵机以获得最佳性能。
{% endhint %}

{% hint style="warning" %}
摩擦在行走过程中的动态平衡中起着重要作用。尽管硅胶脚趾套可以改善抓地力，但它们也会因为不同地面表现出差异。因此，普通条件下建议您不使用硅胶脚垫。除非您自己可以调整步态，或需要很强的摩擦才能执行的特殊任务。
{% endhint %}

## 2.2 未组装的Bittle套件

如果您订购的是未组装的Bittle套件，那么接下来的挑战就是组装了。在了解Bittle背后的设计逻辑同时，您将学到更多有关机器人的知识。更多详细信息，请阅读后面的章节。


# 3 🏗 组装

"整体大于局部的堆砌" 🔩

## 总览

以下是一段Bittle的快速组装动画

{% embed url="<https://www.bilibili.com/video/BV1AV411m7to/>" %}

以下是Bittle组装教学视频

{% embed url="<https://www.bilibili.com/video/BV1z54y1V7r4>" %}

嵌入视频的操控性较差，请移步B站查看[完整播放列表](https://www.bilibili.com/video/BV1z54y1V7r4)。

Bittle组装包括以下几个步骤：

颈部，躯干，大腿，小腿，头，舵机以及电池。

## 颈部组装

材料准备：颈部组件x1，舵机臂x1，M2×8自攻螺丝x2

![](/files/-MSH7z8xpWNIeTnQ8MUv)

将舵机臂按图所示塞入颈部组件中，注意舵机臂的输出齿部分超上方。

![](/files/-MSH7ntSI0bjrpGXEB7M)

将M2\*8自攻螺丝垂直拧入颈部组件的定位孔，请勿拧的过紧导致颈部组件变形。

![](/files/-MSH7r-WSiVepcdckgP-)

装完后，放一边备用。

![](/files/-MSH7NQ5n5WWYKIJCyvc)

## 躯干组装

{% hint style="info" %}
目前在我们的包装中这部分已完成组装。
{% endhint %}

准备材料：颈部组件（已组装）x1， 底板x1，前后挡板x2，左右挡板x2

![](/files/-MSHO1sySOAihVW3-Xda)

将颈部组件安装到底板，圆形标有“A1”字样的为头部。

![](/files/-MSHO6q64QlAdPpTzPU_)

将组装好的颈部组件从后插入底板，双手按压颈部组件前部，将颈部组件卡入底板

![](/files/-MSHOAO-qcMivz7l8TVQ)

插入左侧边框并扣紧

![](/files/-MSHOEfTMDEoeDfwx6Xj)

插入前部挡板，建议先插前部2个卡扣，再插后面的卡扣并扣紧

![](/files/-MSHOHJt9VkA9-jxweIa)

插入后部挡板并扣紧，方向同前部一样。

![](/files/-MSHOLUJbJyFBLse7Ygo)

从前到后分别插入右侧挡板的卡扣

![](/files/-MSHONu_SAcVPR9ZkUgM)

躯干部分就完成了。

## 大腿的安装

纯文字比较难说明，请参考[组装教学视频](https://www.bilibili.com/video/BV1z54y1V7r4?p=2\&share_source=copy_web) 04:12。需要用巧劲而非蛮力，我们的论坛帖子有更多用户总结的[安装技巧](https://www.petoi.com/forum/basic-assembly-and-setup/just-got-my-bittle-kit-can-t-install-springs)的讨论。

![](/files/-McnI4oArvYAMwfUT2mD)

## 小腿安装

准备材料：长线舵机x4，小腿x4，M2×8自攻螺丝x8

![](/files/-MSHUPH5l1-XwYu-bjAm)

右小腿的安装: 将舵机线翻折，如下图塞入小腿组件，锁紧2颗M2×8自攻螺丝即可。

![](/files/-MSHURtKTX_THoFkYp4W)

左小腿的安装：和右腿安装相反，如下图所示（左侧为左小腿，右侧为右小腿）：

![](/files/-MSHUVFtvVKtwQ74kyXI)

安装2只左小腿，2只右小腿，待用。

## 头部的安装

准备材料：短线舵机x1，下巴x1，M2×8自攻螺丝x2。

取出下巴，按图示安装短线舵机，注意舵机出线的位置。

![](/files/-MSGx1rh7BbRRM7hujZb)

将头部卡在下巴上，头部安装完成。

![](/files/-MSGx1riDJBHSa3VguwQ)

## 安装舵机

取出已经装好的框体，4只已经安装长线舵机的小腿，4只短线舵机以及安装好的头部。

将以上部分按图示摆放后，将线穿入框架中央。请注意区分左右小腿，并放置于正确的位置避免装错。

侧面视角：

![](/files/-MSGx1rj1mRI6XoX1U_A)

俯视视角：

![](/files/-MSGx1rk_fMlquMsuEnf)

注意头部舵机的走线。

将短线舵机装入框架对应的凹槽中，注意舵机输出轴的方向。小腿线由舵机下方的走线空位出。安装好后使用M2×8的自攻螺丝锁紧。

![](/files/-MSGx1rl3sNYCnkyFwJ6)

装好4个短线舵机并整理好小腿的线后，此步骤结束。

## 安装电池

{% hint style="info" %}
下图中电路主控版已安装到了机身上，您可以在完成[连线](/zhong-wen/4-lian-xian)操作后回到这里。
{% endhint %}

取出电池，将电池插头插入身体下方的电源插口

![](/files/-MSGx1rtLeUmpYBaER4X)

将电池按下图方向放置，对准安装孔：

![](/files/-MSGx1rzdoXzntKmLhd2)

扣入电池：

![](/files/-MSGx1s-WJF5fzdpptR1)

按住电池的同时向头部方向推动，电池卡到位后整理电源线，如下图所示：

![](/files/-MSGx1s0ooClXKrR9g1Q)

长按电池上的按键3秒以上。若电池上亮红灯，请充电待电池上变为绿灯长亮后再使用。电源开始供电，Nyboard上的黄蓝LED同时发光。

![](/files/-MSGx1rudzULpj0l2yWt)


# 4 🔌 连线

“万物互联” 🤝

## 关节舵机引脚在主板上排序原理

### NyBoard

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

### BiBoard V0

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

### BiBoard V1

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

{% hint style="info" %}
请注意，NyBoard具有靠近机器人尾部的红外接收器，BiBoard V0具有靠近机器人头部的红外接收器，但BiBoard V1没有红外接收器。
{% endhint %}


# NyBoard

## 舵机连线

将舵机的电线连接到 NyBoard 上的PWM引脚，如下图所示， 遵循圆形对称。 注意头部和腿部舵机之间跳过的关节序号（1\~7）， 它们是为我们未来具有更多关节的机器人保留的。

![](/files/KeWBnLlAxBoyKjI2zAsX)

{% hint style="danger" %}
图中关节舵机的序号只与主板上的PWM管脚的位置相关。按照图示接线，不需要阅读 PCB 板上的舵机引脚号。
{% endhint %}

## 舵机线序

接地线（上图示中棕色线，实物是黑色线）应该更靠近电路板。

![](/files/1gHrZ96q4OB9uRYdTd9H)

底视图：

![](/files/dQMaSTeQ6jTJQRfc566V)

将插好线的电路板倾斜插入框架，以便红外接收器可以从尾部伸出，如下图所示：

![](/files/-MSGx1roLjEXU5gMO8Kt)

![](/files/-MSGx1rp5qIwq5oo26h8)

确保所有舵机以正确的方向连接到主板上的正确的引脚针上， 并确保线从主板支撑柱内侧通过，整理好线束后，使用M2x8自攻螺丝固定在4个支撑柱上。

![](/files/-MSGx1rqHSy_1u8i6j33)

完成后如图所示：

![](/files/-MSGx1rrDG7tkZ2yLhvB)

![](/files/-MSGx1rsWV3HPcn2eBT4)


# BiBoard V0

## 舵机连线

虽然 BiBoard 只有 12 个舵机引脚，但关节索引号的配置顺序与 NyBoard 相同。 关节舵机与引脚的连接如下图所示：

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

## 带语音命令扩展板的BiBoard V0的接线说明

接线时请确保黑色地线（或颜色最暗的电线——地线）靠近主板，并确保所有舵机都正确地连接到主板上的正确的引脚针上，且方向正确。

{BiBoard V0舵机接线视频}


# BiBoard V1

BiBoard V1（适用于Bittle X V2）请检查此页面以确定您的BiBoard版本。

虽然 BiBoard V1 只有 12 个舵机引脚，但关节索引号的配置顺序与 NyBoard 相同。 关节舵机与引脚的连接如下图所示：

<figure><img src="/files/5Ovxt7yJFsgjvkkRYwsf" alt=""><figcaption></figcaption></figure>

## BiBoard V1 接线说明

接线时请确保黑色地线（或颜色最暗的电线——地线）靠近主板，并确保所有舵机都正确地连接到主板上的正确的引脚针上，且方向正确。

{% embed url="<https://www.bilibili.com/video/BV1Z19xY1Egt/?share_source=copy_web&vd_source=5b53358e3ed9e3e64243f5234203f423&t=0>" %}


# 5 ⌨️ 配置Nyboard

“谁喜欢炸薯条？” 🍟

为主板上传固件，有两种方法：

* 最简单的方法是使用 [Petoi 桌面应用程序](https://docs.petoi.com/chinese/zhuo-mian-ying-yong/gu-jian-shang-zai)
* 如果您有一定的编程经验，可以使用 Arduino IDE
  * [NyBoard](https://docs.petoi.com/chinese/arduino-ide/wei-nyboard-shang-chuan-cheng-xu)
  * [BiBoard](https://docs.petoi.com/chinese/arduino-ide/wei-biboard-shang-chuan-cheng-xu)


# 6 📐 校准

"失之毫厘，差之千里" 🎯

## 准备校准 <a href="#id-5.2-prepare-for-calibration" id="id-5.2-prepare-for-calibration"></a>

{% hint style="danger" %}
千万不要在第一次校准前把腿装到舵机上。

当舵机断电时，它们的输出轴可能被转到随机的角度，如果这时装上了腿，机器人并不知道这些腿的指向。当机器人上电时，这些腿可能互相冲撞或卡在机身上。长期堵转可能会损坏舵机。
{% endhint %}

机器人的关节需要校准才能继续使用。确保所有的舵机已按正确的方向连接到了主板的正确的位置上，电池正在供电（猫图标的黄色LED 在发光），并且所有的腿和头没有装在舵机上，这些舵机都可以自由旋转。

我们的校准流程会给主板发送一个校准指令，并把所有关节转向已知的角度。您可以把腿按最接近校准姿势的状态安装到关节舵机上，再用软件进行校准。

## 进入校准状态

{% hint style="info" %}
在安装腿和头前必须先进入*校准状态*，然后将头和腿部组件安装在舵机输出轴的齿轮上，但不要拧上螺丝，

进入*校准状态*有5种方法：

* 长按电池上按钮，将机器人身体左/右侧立开机，机器人会自动进入校准状态。下图为机器人进入校准状态并安装好腿部组件的图片。 \
  ![](/files/WflDtZ4r8FOLtpoiKn52)

* 使用移动端应用 **Petoi** App 进入校准界面

* 使用 Petoi 桌面应用程序中 **关节校准** 子程序
  * 如果您已经用串口适配器连接了机器人和电脑，点击“**关节校准**”按钮会自动进入校准状态
  * 点击校准界面中的“**校准位**”按钮

* 在Arduino IDE的串口监视器中，输入串口命令“**c**”&#x20;

* 按下遥控器上的校准按钮 ![](/files/s5nistpvlhnBYscZGPXn)（3,3 - 第 3 行，第 3 列）
  {% endhint %}

### 头部安装 <a href="#install-the-head" id="install-the-head"></a>

在校准中位状态下，将头尽量与中轴线重合，把底部的舵机输出齿插到脖子的舵臂上。

![](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPQ2vWEZUH7ol6XE55o-887967055%2Fuploads%2FTA3mChdgvI00SrUjwxWF%2Fassets_bittle_cali_head01.jpeg?alt=media\&token=b83798da-da31-4a3f-86d3-c5b0f5f86f20)

向下压头部，使其牢牢固定在脖子上

![](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPQ2vWEZUH7ol6XE55o-887967055%2Fuploads%2FFIHY8Rg2swh18iqJ1IWy%2Fassets_bittle_cali_head02.jpeg?alt=media\&token=0abf5909-959f-4cc5-9a4b-4bcb6baa606f)

### 安装大腿，小腿

取出已经局部组装好的大腿，小腿，在Bittle通电并处于校准状态的情况下，分别安装到2个舵机的输出齿。躯干、大腿、小腿请尽可能保持垂直安装，小腿请勿装反，如图所示：

![](/files/1FkUia38OIbAsPvjgrOc)

可以借助三角尺或套件中搭配的L形尺作为参考并进行安装。

![](/files/wwI9ctXBUxHCdS1VXvOI)

通过使用软件，有3种方式可以进入校准状态并对关节进行微调。

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

校准 Bittle 的详细步骤，请参考文档中心的[关节校准](https://docs.petoi.com/chinese/guan-jie-jiao-zhun)。&#x20;


# 7 🔧 总装

“距离胜利只有一步之遥” ⚙️

在完成舵机校准之后，现在进行到了组装Bittle的最后一步: 总装！

如果您的舵机输出齿是金属的，使用M2x4平头螺钉锁紧；如果您的舵机输出齿是塑料的，使用M2x6自攻螺钉（与之前固定舵机的螺钉相同）锁紧。

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

## 7.1 头部安装

从脖子的背面用PH螺丝刀锁入螺钉。

![](/files/-MSGx1ryI_2QiZFNgXwb)

{% hint style="info" %}
在最近的套件中，我们给颈部连接加了挂钩以增强连接强度。对于之前的套件，您可以 3D 打印一个 [Bittle 颈锁](https://github.com/PetoiCamp/NonCodeFiles/tree/master/stl/Bittle%20%26%20BittleX/BittleNeckLock) (如下图所示)来加强颈部连接。

<img src="/files/464G25vcOeStgMYkXQkv" alt="" data-size="original">  <img src="/files/RWjMWAOsurwd17MpcSAX" alt="" data-size="original">
{% endhint %}

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

## 7.2 腿部安装（大腿和小腿）

使用螺钉锁紧舵机输出齿和舵臂，依次安装4条大腿，4条小腿。

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

## 7.3 安装腿部线罩

从包装中取出线罩，线罩两端各有2个卡口，高卡口对应黄色的部分，矮卡口对应黑色的部分。

确保小腿舵机线缆没有过分缠绕打结后，将线罩卡入大腿部分。

![](/files/-MSGx1s4arzqRxZ1dR5z)

正确的安装（线罩是平的）：

![](/files/-MSGx1s5HfdJUxx29Qcy)

错误的安装（线罩是歪的）：

![](/files/-MSGx1s6t1M4jGg9sHQc)

## 7.4 安装上盖及尾巴

Nyboard尾部的加长6针母座是为了安装下载器及各种扩展模块。当无需安装树莓派时，请向头的方向以一定弧度轻轻弯折：

![](/files/-MSGx1s3zy4Kl_VYTCmY)

取出上盖和尾巴，将尾巴扣入上盖后方的固定孔内：

![](/files/-MSGx1s7aOVm3KYNftwP)

将上盖从一侧装入Bittle躯干，扣紧即可。若有舵机线束卡住外壳，请整理线束后再盖上上盖。

![](/files/-MSGx1s8eY3VmcEWf6Sl)

到止Bittle的组装就全部完成了。


# 8 🕹 动手玩Bittle

经历了前面的组装工作，现在的Bittle应该已经可以完美行走了～

那么，来玩吧！

没有任何编程经验的用户可以通过以下4种方式来控制Bittle：

* 使用[**红外遥控器**](https://docs.petoi.com/v/chinese/hong-wai-yao-kong/yao-kong-qi)
* 使用手机应用 [**Petoi**](https://docs.petoi.com/v/chinese/shou-ji-ying-yong/kong-zhi)
* 使用桌面应用程序[**技能创作坊**](https://docs.petoi.com/v/chinese/zhuo-mian-ying-yong/ji-neng-chuang-zuo-fang)
* 使用[**Petoi编程积木**](https://docs.petoi.com/v/chinese/tu-xing-hua-bian-cheng/petoi-bian-cheng-ji-mu)

如果你有一定的编程经验或想探索更高级的功能，可以尝试以下方法：

* 使用 [**Arduino IDE**](https://docs.petoi.com/v/chinese/chuan-kou-xie-yi)
* 使用 [**Python**](https://docs.petoi.com/v/chinese/api/serialmaster-shi-yong-zhi-nan)
* 使用 [**MicroPython**](https://docs.petoi.com/v/chinese/tong-xin-mo-kuai/wifi-mo-kuai-esp8266/micropython-kong-zhi-qi)
* 使用 [**ESP8266 + Python**](https://docs.petoi.com/v/chinese/tong-xin-mo-kuai/wifi-mo-kuai-esp8266/shi-yong-esp8266-+-python-jiao-ben-shi-xian-wu-xian-qun-kong)
* 使用 [**Raspberry Pi**](https://docs.petoi.com/v/chinese/api/tong-guo-shu-mei-pai-kong-zhi-ji-qi-ren)
* 使用[**扩展模块**](https://docs.petoi.com/v/chinese/kuo-zhan-mo-kuai/kuo-zhan-mo-kuai-gai-yao-shuo-ming)


# 9 👨‍🏫 教Bittle新动作技能

为Bittle创作新技能，有两种方法：

* 使用桌面应用程序的[技能创作坊](https://docs.petoi.com/v/chinese/zhuo-mian-ying-yong/ji-neng-chuang-zuo-fang)
* [编写Arduino程序代码](https://petoi.gitbook.io/r-and-d-memo/)


# 10 👨‍🎓 了解Bittle怎么工作

## 🔬详细解读大概能编成一套课本了

Bittle 背后的设计框架是 OpenCat，我已经开发了一段时间。 您可以在Hackster.io上读到我早年的几篇[帖子](https://www.hackster.io/petoi/opencat-845129)，作为业余爱好几经寒暑，竟成了我创业的契机。

![](/files/-MShc6IRKyzRVWzYnJZ8)

目前我忙于生产的流程和品控，暂时无暇系统整理。🤷🏻‍♂️ 但是欢迎同好通过论坛或电邮和我讨论，比如论坛上有用户作的[代码分析](https://www.petoi.com/forum/software/flavien-opencat-code-reviews)。我也会保持目前代码和未来OpenCat产品线的兼容性，甚至可以驱动[玩家DIY的机器人](https://www.petoi.com/forum/showcase)。希望本文档可以在项目进行中逐渐完备起来。


# 11 🔩 给Bittle准备一些新玩具

## 具体详情请参考文档中心[扩展模块](https://docs.petoi.com/v/chinese/kuo-zhan-mo-kuai/kuo-zhan-mo-kuai-gai-yao-shuo-ming)相关章节。


# Petoi Bittle 取扱説明書 🐶

きびだんご株式会社

{% hint style="danger" %}
**常時更新中 Last updated 09/09/2020**
{% endhint %}

はじめに\
**【注意】初期不良対応は受け取りから7日間となっておりますので、商品が届きましたら必ず中身をご確認下さい。**

![](/files/-MfoCkdQMCLkdtOV6W1P)

お問合せやご質問は[こちら](https://kibidango.com/message/create?uid=83983)にお願い致します。メールでのお問い合わせ先：<cs@kibidango.com>

{% hint style="info" %}
Last Updated: 07/30/2021
{% endhint %}


# 1 🧘‍♂️道具と準備

"A beard well lathered is half shaved." 🪒

## 1.1. 事前準備

きれいな机と、パッケージの中身を入れる小さな箱を用意してください。後で何かを紛失したときのために、キットの中身の写真を撮っておきましょう。

{% hint style="success" %}
カーペットやモザイク床のない部屋で作業をするのが良いでしょう。小さなネジやバネは、地面に落とすと魔法のように消えてしまいます。
{% endhint %}

## 1.2. 工具・アクセサリー

{% tabs %}
{% tab title="必須" %}

| 工具                    | メモ                                                                       |
| --------------------- | ------------------------------------------------------------------------ |
| マイナスドライバーとプラスドライバー    | For M2 (diameter = 2mm) screws M2（直径＝2mm）のネジ用                            |
| Arduino IDEを搭載されたパソコン | 最新の [Arduino IDE](https://www.arduino.cc/en/Main/Software) をインストールしてください |
| USB充電ポート              | 5V 1Aの出力で十分です                                                            |
| {% endtab %}          |                                                                          |

{% tab title="任意" %}

| 工具                                                | メモ                                                                                          |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Soldering iron w/ accessories　はんだこて（付属品付          | For modifying the PCB if you are a hacker!　プリント基板の改造には、ハッカーのような方におすすめです。                    |
| 3D printer w/ accessories　3Dプリンターｗ（付属品付           | Add your special design　特別なデザインの追加                                                          |
| Arduino/Raspberry Pi kit　Arduino/Raspberry Pi キット | Add more gadgets to Bittle　バイトルへのガジェット追加                                                    |
| Multimeter　マルチメーター                                | Test and debug　テストとデバッグ                                                                     |
| Oscilloscope　発振器                                  | Test and debug　ストとデバッグ                                                                      |
| Hot glue/super glue　ホットグルー/スーパーグルー                | Avoid using them. Bittle is designed to be glue-free! 使わないようにしましょう。バイトルは接着剤を使わないように設計されています |
| {% endtab %}                                      |                                                                                             |
| {% endtabs %}                                     |                                                                                             |


# 2 🧩 箱の中身をご確認下さい

"life is like a box of Bittle." 🔍

![未組立バイトルキットと組立済みバイトル](/files/-MTP_8X4UVnCAGJtESZh)

## 2.1. Pre-assembled Bittle 組立済みバイトル

組み立て済みのバイトルが届いた場合は、首を胴体に差し込んで、**膝を自然な角度に曲げる必要があります**。巻き線を膝側から肩側に引きずるようにして、膝関節が回転したときに圧迫感が出ないようにします。

![](/files/-MSmyAEyBm8iJJ42uyMK)

電池のボタンを2～3秒長押しすると、電源のオン/オフができます。赤外線リモコンの電池の絶縁シートを抜くと、[バイトルの動きをコントロールできる](https://bittle.petoi.com/7-play-with-bittle)ようになります。

{% hint style="warning" %}
組み立て済みのバイトルは、あくまでも粗調整されたものです。[Arduino IDEをセットアップして](https://bittle.petoi.com/4-configuration)、[バイトルのセンサーを較正し](https://bittle.petoi.com/6-calibration)、最高のパフォーマンスを発揮するためにジョイントを微調整する必要があります。
{% endhint %}

{% hint style="warning" %}
摩擦は、歩行時のダイナミックなバランスに重要な役割を果たします。シリコン製のつま先カバー（ソックス）は、グリップ力を向上させることができますが、テスト環境の予測不可能な表面の違いを増幅させてしまいます。そのため、通常の使用では、歩行を調整したり、特定の作業を行うために摩擦を必要とする場合を除き、ソックスなしでバイトルを走らせることをお勧めします。
{% endhint %}

## 2.2. 未組立バイトルキット

組み立てられていないバイトルのキットを注文した場合、挑戦的で楽しいパズルを解かなければなりません。バイトルの設計論理を理解した上で、ロボット工学について学ぶことができます。詳しくは次の章をご覧ください。


# 3 🏗 フレームの組み立て

"The whole is more than the sum of its parts." 🔩

## 3.1. 組み立て動画

&#x20;

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

実際に組み立てている動画はこちら。&#x20;

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

## 3.2. 組み立て方

以下のパーツを完成させて、後の章でまとめることができます。

* ボディ
* アッパーパーツ
* Lower leg
* 頭部
* 肩サーボ&#x20;

### 3.2.1. 首部分

使用するパーツ：

* 首パーツ x 1
* サーボアーム x 1
* M2x8 ネジ x 2

![](/files/-MTM-WiLiUQ4UqWFshk8)

下記の写真のようにサーボの歯が上に向くようにしてください。

![](/files/-MTM-WiMQVG5EHLlMm6T)![](/files/-MTM-WiNrekkfKsoEKhm)

ネジを二つ左右にしめてください。締めすぎには注意してください。&#x20;

![](/files/-MTM-WiO9OR_VuXkRcNk)![](/files/-MTM-WiPv0UGMcRj7wRs)

完成図

![](/files/-MTM-WiQF3VPFvoxHVCi)

### 3.2.2. ボディー

使用するパーツ:

* 組み立てた首部分のパーツ
* シャーシ
* プレート x 2
* サイドショルダー x 2

![](/files/-MTM-WiRJDfVd1N1ikmc)

シャーシには向きがあります。"A1"のマークがあるほうが後ろ（尻尾）です。

![](/files/-MTM-WiSqQE_8K3MCTXL)![](/files/-MTM-WiTX24179iptTH6)

後ろのひっかけ部分を先に挿入してから、前のフックを音が鳴るまで優しく押し込んでください。

![](/files/-MTM-WiUgMBmPHYf55aG)![](/files/-MTM-WiVYNOQNQIpZ2oR)

{% hint style="info" %}
サーボやボディへのダメージを緩和するために衝撃が加わるとすぐ外れる仕様になっています。
{% endhint %}

シャーシに肩のパーツを挿入してください。その後、プレートを挿入し反対も同様に肩のパーツを挿入してください。

![](/files/-MTM-WiWzXigZeeiYPid)![](/files/-MTM-WiXtzI_k4VojJz1)

![](/files/-MTM-WiYOcJPiD0fl7eD)![](/files/-MTM-WiZiJODbAkOt8Fv)

![](/files/-MTM-Wi_e-huKvoeamsf)

![](/files/-MTM-Wia4vf4B2MOaQSR)

完成図

![](/files/-MTM-Wibow6VZCJANyUj)

### 3.2.3. 肩のサーボ取り付け方

[動画](https://www.youtube.com/watch?v=oJ2Y9hZgCEY\&t=203s)を参照してください。

### 3.2.4. 脚部

使用するパーツ

* 脚部パーツ x4
* M2x8ネジ x 8

![](/files/-MTM-WicMvS9YEFhmVW2)

右側の脚部は以下の写真のように組み立てます。前足と後ろ足は同じ形になります。

長いケーブルがついたサーボを使てください。サーボの挿入する向きがありますのでご注意ください。

![](/files/-MTM-WidAJU_AlLwaged)![](/files/-MTM-Wie_uiWMeASHUgs)![](/files/-MTM-Wifgyr_q_pILMpb)

左側の脚部と右側の脚部でサーボを挿入する向きが異なります。

![](/files/-MTM-WigHuB0M6J5iSJU)

### 3.2.5. 頭部

Materials:

* 顎パーツ x 1
* 頭部パーツ x 1
* P1S サーボ （短いケーブル） x 1
* M2x8ネジ x 2

サーボを写真のように顎パーツに挿入します。サーボのケーブルの向きに注意してください。サーボを挿入後ネジをしめてください。&#x20;

![](/files/-MTM-Wihvko0B8KyoqzV)

次に頭部パーツを装着して完成です。&#x20;

![](/files/-MTM-WiigCEWbC8D08bm)

### 3.2.6. 組み立て

Materials:

* P1S サーボ （短いケーブル） x 4
* M2x8ネジ x 8
* 頭部
* ボディー
* 脚部 x 4

下の写真のようにサーボを挿入し、組み立てたパーツを組み合わせてください。

側面図

![](/files/-MTM-WijmZALXT6d5LPm)

トップ図

![](/files/-MTM-WikA3OwjmDF-WiK)

サーボを正しく挿入できていることを確認したらサーボと肩の部分をネジで固定してください。この時まだ、サーボのモーター部分のねじ止めは行わないでください。

![](/files/-MTM-Wil8VtTgzvbFdNI)


# 4 ⌨️ ボード設定

"Who loves fried chips?" 🍟

## 4.1. NyBoard

**4.1. NyBoard**

### 4.1.1. **取扱説明書を読んでください**

**説明書の「NyBoard」について内容を見つけて、**[**NyBoard V1\_0**](https://app.gitbook.com/@petoi/s/docs/nyboard/nyboard-v1_0#introduction-to-the-onboard-components)**の説明を読んでください。**

{% hint style="danger" %}

**注意！誤操作によるNyBoardに損害を与える可能性があります！**<br>
{% endhint %}

### 4.1.2. Dial the slide switch to Arduino.スライドスイッチからArduinoをダイヤルしてください

**I2C装置（ジャイロ/加速度計,サーボドライバ, 外部暗号化EEPROM）のマスターをスライドスイッチで変更します。**

**デフォルトの "Arduino "では、NyBoardはオンボードのATmega328Pをマスターチップとして使用し、"Pi "では、I2Cポート（SDA、SCL）で接続された外部チップをマスターチップとして使用します。**<br>

{% hint style="warning" %}

どうしても起動できない場合は、もしかしたらスイッチを誤って「Pi」にしてしまったのかもしれません。
{% endhint %}

**NyBoardは7.2Vのバッテリーでメタルギアサーボを直接駆動します。満充電時には8.4Vになります。NyBoardで自作のプラスチックギア付きサーボを直接駆動することはできません。**<br>

## 4.2. ダウンロードとインストール

下記のサイトよりお使いのコンピューターのOSに対応するArduino IDEをダウンロードしてください。

Arduino IDEのダウンロードサイトは[こちら](https://www.arduino.cc/en/software)

{% hint style="info" %}
最新バージョンのArduino IDEをダウンロードしてください。
{% endhint %}

### 4.2.1. ライブラリーマネージャーからインストール

Arduino IDEを起動したら、"Tools"タブの"Manage Libraries"をクリックしライブラリーマネージャーを開いてください。下記のライブラリーをインストールしてください。

* **Adafruit PWM Servo Driver　（最新バージョン）**
* **IRremote　（バージョン2.6.1）**
* **QList　 (任意)**

{% hint style="warning" %}
IRremｃ
{% endhint %}

ファインダーから**Documents/Arduino/libraries/IRremote/src/IRremote.h**のファイルをテキストエディタなどで開き、**#define DECODENEC***と***#define DECODE\_HASH**だけを**1**と入力し、**それ以外は0**と入力してください。

{% hint style="warning" %}
プログラミングスペースを確保するため、上記の操作を必ず行ってください。
{% endhint %}

![](https://lh4.googleusercontent.com/cJqrlCMXKyf2VR4nA5piZtSaRS-3I79dWBcqLozk8U5nT_Fdpa2fR9vJLb5z9tTA8FUXKGGOreJeoHgBjKdmsoecXU58an5mGtZt_UdsrIdE84XBQwE9geH71hrF-EFHJEbDTrfM)

### 4.2.2. .ZIP libraryのインストール

下記のリンクからGitHub上のZipファイルをダウンロードしてください。ダウンロードしたらZipファイルを展開してください。

Zipファイルのリンクは[こちら](https://github.com/jrowberg/i2cdevlib)

![](/files/-MShiEL_0GPAts9ACczD)

次にArduino IDEの”**スケッチ**”のタブから”**ライブラリーをインクルード**”内の”**Zip形式のライブラリーをインストール**”をクリックしてください。

![](/files/-MShib4HQig6HgqGRJsv)

フォルダ名”**Arduino**"内の"**MPU6050**"と**12Cdev**"のフォルダを追加してください。

![](/files/-MShiRFpswuKffXOzjmI)

### 4.2.3. NyBoardサポートをArduino IDEに追加&#x20;

&#x20;次に"**ツール**”タブから使用するボード”（ボード：**Arduino Uno**)”を選択してください。予め選択されている場合もあります。

![](/files/-MShixJJHQEtH_0iur_z)

### 4.2.4. ブートローダーを焼く（通常の使用では必要ありません)

{% hint style="warning" %}

**NyBoardのブートローダが崩壊した場合のみ**
{% endhint %}

●      [What is a bootloader?](https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader) [ブートローダとは何ですか？](https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader)

すべてのNyBoardは出荷前に機能チェックを行っているため、互換性のあるブートローダがインストールされているはずです。しかし、まれにブートローダが壊れてしまい、Arduino IDEからスケッチをアップロードできなくなることがあります。

スケッチのアップロードができないのは、必ずしもブートローダのせいではありません:

* USBボードがデバイスからの大きな電流を検知して、USBサービス全体を停止させることがあります。この場合、USBサービスを再起動するか、コンピュータを再起動する必要があります。&#x20;
* UARTアップローダにFTDI USB 2.0のドライバをインストールする必要があります。&#x20;
* 正しいポートを選択していない。&#x20;
* 接触不良です。&#x20;
* 運が悪かった。明日改めて試してください。 &#x20;

どうしてもブートローダを焼き直したいと思う場合は:

* NyBoard V1\_\*の場合は、Arduino IDEのツールメニューでArduino Unoを選択するだけです。&#x20;
* ISP（In-System Programmer）を選択します。上のスクリーンショットでは、2つのポピュラーなプログラマーが表示されています。ハイライトされている USBtinyISP は安価なブートローダーで、チェックされている [Arduino as ISP ](https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP)は通常の Arduino を ISP として使用できます。&#x20;
* プログラマーをNyBoardのSPIポートに接続します。接続するときは方向に注意してください。しっかり接触しているか確認してください。&#x20;
* ブートローダを書き込みます。初めての場合は、数本のパーセントバーが100%になり、メッセージが出なくなるまで1分ほど待ちます。

### 4.2.5. USBドングルを接続

![](/files/-MSGx1s9ciJZnD5Opgt7)

USBドングルを付属のケーブルでコンピューターに接続してください。USBドングルを差し込む向きに注意してください。DTRと記載されているピンがボードのDTRに挿入されるように差し込んでください。バッテリーはあらかじめ電源がオンになった状態で本体に接続しといてください。

{% hint style="warning" %}
バッテリーが未装着または電源が入っていない場合「ピー」と音が鳴ります。
{% endhint %}

**Linuxの場合、アップローダがコンピュータに接続されると、シリアルポートリストに「ttyUSB#」が表示されます。しかし、アップロード時にシリアルポートエラーが発生することがあります。その場合は、シリアルポートに許可を与える必要があります。このリンクにアクセスして、指示に従ってください：** [**https://playground.arduino.cc/Linux/All/#Permission**](https://playground.arduino.cc/Linux/All/#Permission)<br>

![](/files/-MShjzkf6LcwnznCo2cj)

USBドングルとコンピューターが正常に接続されたら**ツール**>**シリアルポート**>**/dev/cu.usbserial-xxxx（Macの場合）**&#x307E;たは**COM#（Windowsの場合）**&#x3092;クリックしてください

{% hint style="info" %}
接続してもポートが表示されない場合、CH340チップ用のドライバーをインストールする必要がある場合があります。

Mac: <http://www.wch.cn/download/CH341SER_MAC_ZIP.html>

Windows: <http://www.wch.cn/download/CH341SER_EXE.html>
{% endhint %}

4.2.6

### 4.2.7. OpenCatパッケージをダウンロードする。

{% hint style="info" %}
We keep updating the codes as an open-source project. You can star and follow our [GitHub repository](https://github.com/PetoiCamp/OpenCat) to get the newest features and bug fixes. You can also share your codes with worldwide OpenCat users.&#x20;
{% endhint %}

下記のリンクからライブラリーのインストールと同様にZipファイルをダウンロードをしてください。ダウンロードする際はすべてのファイルを一括でダウンロードしてください。コードのバージョンが異なると正常に動作しない場合があります。

Zipファイルのリンクは[こちら](https://github.com/PetoiCamp/OpenCat)

![](https://lh3.googleusercontent.com/9tm52ev7oDTL71QgrYJmFpD2B-7gr3mls13Ih-DiqhQ1rJpqf7ZNhAyqrnj5Tx_CaQ1PN11LjprGMbB-nwwDAw4JuLPPmR3-xs6j4PxkIyWaoXN65D6OMVgmcgcat-r4pCM4D8tB)

ダウンロードしたZipファイルを展開してください。展開したファイルは**OpenCat-main**というフォルダが表示されます。ファイル名を**OpenCat**に変更してください。

{% hint style="warning" %}
ファイル構造は以下のようになるようにしてください。

&#x20;<img src="/files/-MVt-QiH5iCbvlUfwxjA" alt="" data-size="original">&#x20;
{% endhint %}

* ・ModuleTests フォルダには、いくつかの testX.ino コードがあります。これらをアップロードして、特定のモジュールを個別にテストすることができます。test "という接頭辞のついた testX.ino スケッチを開いてください。(最初のテストスケッチとして testBuzzer.ino を使うことをお勧めします。) ・シリアルモニターを開き、ボーレートを設定します。NyBoard V1\_\*の場合、ボードはArduino Unoを選択し、コードとシリアルモニターの両方でボーレートを115200に設定してください。 ・コードをコンパイルしてください。エラーメッセージは出ないはずです。スケッチをボードにアップロードすると、TxとRxのLEDが急速に点滅するのが見えるはずです。点滅が終わると、シリアルモニタにメッセージが表示されます。 ・コマンドを入力する前に、"No line ending "が設定されていることを確認してください。そうしないと、目に見えない '\n' や '\r'の文字が解析機能を混乱させてしまいます。

![](/files/-MShkpvFy_DRFgZQok20)

Linuxマシンでは、「permission denied」のようなエラーメッセージが表示されることがあります。Arduinoスケッチをコンパイルするためには、avr-gccに実行権限を付与する必要があります。

`sudo chmod +x filePathToTheBinFolder/bin/avr-gcc`

さらに、/bin内の**すべてのファイル**に実行権限を追加する必要があるので、次のようにコマンドを実行します

`sudo chmod -R +x /filePathToTheBinFolder/bin`

## 4.3. Arduino IDE as an interfaceインターフェイスとしての Arduino IDE

&#x20;NyBoard と Arduino IDE を接続する USB/Bluetooth アップローダがあれば、NyBoard と通信してバイト単位で変更できる究極のインターフェイスになります。

NyBoard と Arduino IDE を接続する USB/Bluetooth アップローダがあれば、NyBoard と通信してバイト単位で変更できる究極のインターフェイスになります。

NyBoard のシリアル通信プロトコルを定義しました：

![](/files/-MShlDyFvK66IA6mVmYi)

すべてのトークンは、その解析形式を指定するために、1つのAsciiエンコードされた文字で始まります。これらの文字は、大文字と小文字を区別し、通常は小文字である。

{% hint style="info" %}

cコマンドやmコマンドのように、いくつかのコマンドは組み合わせることができます。 例えば 連続した「m8 40」、「m8 -35」、「m 0 50」は、「m8 40 8 -35 0 50」のように表記できます。同じ種類のコマンドは4つまで組み合わせることができます。正確には、文字列の長さは30文字以下でなければなりません。コード内で制限を変更することもできますが、シリアルバッファのシステム的な制約があるかもしれません。
{% endhint %}

{% hint style="warning" %}
hのように実装されていないトークンもあります。

{% endhint %}

## 4.4. ラズパイをマスターコントローラーとして使う場合

{% hint style="warning" %}
Piをマスターコントローラーとして使用する場合のみ。バイトルはPiがなくても動きます。
{% endhint %}

NyBoardにラズペリーパイを適用する場合は2x5(10ピン)を利用してください。ペトイビトルでの推奨モデルはPi 3A+です　NyBoardにラズペリーパイを適用する場合は2x5(10ピン)を利用してください。ペトイビトルでの推奨モデルはPi 3A+です

{% hint style="danger" %}
ソケットに半田付けするとペトイビトルのカバーをつけれなくなるのでご注意ください。ソケットに半田付けするとペトイビトルのカバーをつけれなくなるのでご注意ください。
{% endhint %}

通信プロトコルにあるようにArduino IDEのシリアルモニターは全てアスキー文字列でエンコードされています。一方でラズパイなどのマスターコンピューターは追加のコマンドがあります。その大部分はエンコードを効率化するためバイナリ文字列で組まれています。Nybbleとラズパイのシリアル通信についてはパイソンスクリプト[ardSerial.py](https://github.com/PetoiCamp/OpenCat/blob/main/serialMaster/ardSerial.py)に簡易的に示してあります。

* Ascii: takes 2 bytes to store Ascii characters '6' and '5'
* Binary: takes 1 byte to store value 65, corresponding to Ascii character 'A'
* Ascii: 2バイトでAscii文字の'6'と'5'を格納します。&#x20;
* Binary: 1バイトでAscii文字の'A'に相当する値65を格納します。

{% hint style="info" %}
What about value -113? It takes four bytes as an Ascii string but still takes only one byte in binary encoding, though the content will no longer be printable as a character.&#x20;

値-113はどうでしょうか？Ascii文字列では4バイト必要ですが、バイナリエンコーディングでは1バイトしか必要ありません。 明らかに、バイナリエンコーディングの方がAscii文字列よりもはるかに効率的です。
{% endhint %}

Obviously, binary encoding is much more efficient than the Ascii string. However, the message transferred will not be directly human-readable. In the OpenCat repository, I have put a simple Python script [ardSerial.py](https://github.com/PetoiCamp/OpenCat/tree/master/SerialMasterPython) that can handle the serial communication between NyBoard and Pi.

しかし、転送されるメッセージは、直接人間が読めるものではない。OpenCatのリポジトリには、NyBoardとPiの間のシリアル通信を処理できる簡単なPythonスクリプトardSerial.pyを置いています。

### 4.4.1. ラズパイシリアルポートの設定

ラズパイのターミナルに”sudo raspi-config”を打ち込みます。

インターフェースオプションのもと、シリアルを選択しシリアルログインシェルを無効にしてシリアルインターフェースを有効にしてください。<br>

1. Run **raspi-config** with **sudo** privilege: `sudo raspi-config`.
2. Find Interface Options -> Serial Port.
3. At the option `Would you like a login shell to be accessible over serial?` select 'No'.
4. At the option `Would you like the serial port hardware to be enabled?` select 'Yes'.
5. Exit raspi-config and reboot for changes to take effect.
6. Sudo raspi-config を sudo 権限で実行します。
7. &#x20;インターフェースオプション」→「シリアルポート」を探します。&#x20;
8. Would you like a login shell to be accessible over serial?で「No」を選択します。
9. シリアルポートのハードウェアを有効にしますか」というオプションで「Yes」を選択します。
10. raspi-configを終了して再起動すると、変更が反映されます。

{% hint style="info" %}
[A good tutorial on the Pi Serial](https://www.raspberrypi.org/documentation/configuration/uart.md)
{% endhint %}

If you plug Pi into NyBoard's 2x5 socket, their serial ports should be automatically connected at 3.3V. Otherwise, pay attention to the Rx and Tx pins on your own AI chip and its voltage rating. The Rx on your chip should connect to the Tx of NyBoard, and Tx should connect to Rx.

PiをNyBoardの2x5ソケットに接続した場合、シリアルポートは自動的に3.3Vで接続されるはずです。そうでない場合は、自分のAIチップのRxとTxピンとその電圧定格に注意してください。チップの Rx は NyBoard の Tx に、Tx は Rx に接続する必要があります。

### 4.4.2. **ardSerial.pyの許可を変更する**

If you want to run it as a bash command, you need to make it executable:

bashコマンドとして実行したい場合は、実行可能な状態にしてください。

`chmod +x ardSerial.py`

You may need to change the proper path of your Python binary on the first line:

chmod +x ardSerial.py 1行目でPythonバイナリの適切なパスを変更する必要があるかもしれません。

`#!/user/bin/python`

### 4.4.3. Use **ardSerial.py** as the commander of Bittle　バイトルのコマンダーとしてardSerial.pyを使用する

{% hint style="warning" %}
NyBoard has only one serial port. You need to UNPLUG the FTDI converter if you want to control Bittle with Pi's serial port.　NyBoard にはシリアルポートが 1 つしかありません。PiのシリアルポートでBittleを制御するには、FTDIコンバーターを外す必要があります。
{% endhint %}

Typing `./ardSerial.py <args>` is almost equivalent to typing \<args> in Arduino's serial monitor. For example, `./ardSerial.py kcrF` means "perform s**k**ill **cr**awl **F**orward".

./ardSerial.py を入力することは、Arduinoのシリアルモニタでを入力することとほぼ同じです。例えば、./ardSerial.py kcrFは「perform skill crawl Forward」という意味です。

Both **ardSerial.py** and the parsing section in **OpenCat.ino** need more implementations to support all the serial commands in the protocol.

ardSerial.pyとOpenCat.inoの解析セクションの両方とも、プロトコルのすべてのシリアルコマンドをサポートするために、さらに多くの実装が必要です。

## 4.5. バッテリー

Though you can program NyBoard directly with the USB uploader, external power is required to drive the servos. NyBoard は USB アップローダで直接プログラミングできますが、サーボの駆動には外部電源が必要です。

### 4.5.1. 電圧

NyBoard requires 7.4\~8.4V external power to drive the servos. We include our customized Li-ion battery with built-in charging and protection circuit in the Bittle kit. Short press the battery's button will show its status. Blue light indicates it has power, and red means the power is low. Long press the button for 2.5 seconds to turn on/off the battery.&#x20;

NyBoard はサーボを駆動するために 7.4～8.4V の外部電源が必要です。バイトルのキットには、充電回路と保護回路を内蔵した当社オリジナルのリチウムイオン電池が付属しています。電池のボタンを短く押すと、電池の状態が表示されます。青色は電源が入っていることを示し、赤色は電源が低下していることを示します。ボタンを2.5秒長押しすると、バッテリーのオン/オフができます。

### 4.5.3. 接続方法&#x20;

Be careful with the polarity when connecting the power supply. The terminal on NyBoard has an anti-reverse socket, so you won't be able to plug in the wrong direction. 電源を接続する際は、極性に注意してください。NyBoard の端子には逆転防止用のソケットが付いていますので、間違った方向に接続することはありません。&#x20;

{% hint style="danger" %}
逆に接続すると、NyBoard が破損する恐れがあります!
{% endhint %}

### 4.5.4. バッテリーの寿命は使用状況によって変わります

It can last hours if you're mainly coding and testing postures, or less than 30 mins if you keep Bittle running.&#x20;

The battery light will turn red when the power is low. The power will be cut off automatically.&#x20;

主にコーディングや姿勢のテストをしている場合は何時間も持ちますし、Bittleを動かし続けている場合は30分以下になります。 電池残量が少なくなると、バッテリーランプが赤くなります。自動的に電源が切れるようになっています。

### &#x20;4.5.5. 充電について

Use a **5V-1A** USB charger to charge the battery. We don't recommend using fast chargers. The battery will **NOT** supply power during charging. Keep the battery in your sight when charging.&#x20;

バッテリーの充電には、5V-1AのUSB充電器を使用してください。急速充電器の使用はお勧めできません。充電中は、バッテリーから電源が供給されません。充電中は、バッテリーを目の届くところに置いてください。

### 4.5.6. 使用後

After playing, remember to turn off the battery. It's recommended to unplug the battery from the NyBoard's terminal.  プレイ後は、忘れずにバッテリーをオフにしてください。NyBoard の端子からバッテリーを抜くことをお勧めします。


# 5 🔌 配線

"Everything is connected." 🤝

## 5.1. サーボの配線

サーボのボードへの接続は以下の写真のようになります。

{% hint style="warning" %}
頭のサーボは肩のサーボと接続するピンから一個飛ばしたピンに接続してください。
{% endhint %}

![](/files/-MfoBkc8VxOormYsuDZw)

黒色のワイヤ (GND ワイヤ)がボードに近くなる方向でつなげてください。 &#x20;

![](/files/-MTM-WimcJAGGrjcnrOw)

![](/files/-MTM-Win_KDbqjJgjyNA)

赤外線センサーがボディーの外に出るようにしてください。

![](/files/-MTM-Wio4N0I-BzZoewa)

![](/files/-MTM-WipuCZN-A2JuJb8)

サーボのワイヤがすべて収まるようにしてください。

![](/files/-MTM-Wiq2hlW3IXgI7rm)

Completed:

![](/files/-MTM-WirguxJis5un9Fx)

![](/files/-MTM-Wisp_7IuDcaDNJk)

## 5.2. バッテリー

バッテリーの挿入する向きに注意してください。&#x20;

![](/files/-MTM-Wit5-uqpzcaAQZ4)

バッテリー上のボタンを３秒以上押し続けてください。バッテリーの電源が入った状態でつなげるとボード上の猫の目が光ります。

![](/files/-MTM-WiuHEay6hsHRlkN)


# 6 📐 キャリブレーション

"A miss is as good as a mile." 🎯

{% hint style="info" %}
Bittleが正常に動作するためには、キャリブレーションが不可欠です。
{% endhint %}

これまでのセクションでは、Bittleのボディパーツの準備をしましたが、サーボにネジ止めを行っていませんでした。これは、ボディパーツをサーボに正しい角度で取り付けるためのキャリブレーションが必要だからです。

サーボを取り付ける前にキャリブレーションを行わないと、ありとあらゆる方向に回転したり、スタックして動かなくなったり、サーボやボディにダメージを与えるなど、ロボットの手脚が正常に動作しなくなる可能性があります。

キャリブレーションは以下のステップで行われます。

1. 定数を基板に書き込む&#x20;
2. 回路の電源を入れ、サーボを自由に回転させて、角度をゼロの状態にする／キャリブレーションを行う&#x20;
3. サーボにボディパーツを取り付ける&#x20;
4. ボディパーツの配置を微調整し、キャリブレーションの結果を基板に保存する

必ずバッテリーの電源を入れてからご使用ください。

The [logic behind calibration](https://www.petoi.com/forum/basic-assembly-and-setup/the-logic-behind-calibration-process) can be found on the OpenCat forum. The principles are the same for Nybble and Bittle.&#x20;

[キャリブレーションの原理](https://www.petoi.com/forum/basic-assembly-and-setup/the-logic-behind-calibration-process)はOpenCatのフォーラムに書いてあります。ここではNybbleを例に説明していますが、原理はNybble、Bittle共一緒です。

## 6.1 NyBoardに定数を入力する

### 6.1.1. NyBoardに保存する３つの定数について：

1. ジョイントマッピングや回転方向、センサーピンといった組み立てに関する定数の大部分は**OpenCat.h**に保存されています。
2. MPU6050のオフセットやジョイント補正などのパラメーターはリアルタイムで基盤のEEPROMに保存されています。
3. 姿勢、歩き方などのスキル関係のデータは**InstinctBittle.h**に保存されています。オリジナルのスキルを追加することも可能です。 &#x20;

### 6.1.2. **WriteInstinct.inoをアップロードして実行する**

**WriteInstinct.ino**の主な役割は定数を基盤またはI2C EEPROMに記録し、キャリブレーションデータを保存することです。**WriteInstinct.ino**は後でメインスケッチの**OpenCat.ino**に上書きされます。

{% hint style="warning" %}
**OpenCatフォルダ**内にある**OpenCat.ino**と**WriteInstinctフォルダ**内の**WriteInstinct.ino**を開いてください。使用するボードがArduino UNOであることと適切なUSBポートが選択されていることを確認してください。**OpenCat.h**の”**#define NyBoard\_V\*\_\***”における\*の部分に対応するNyBoardのバージョンを入力してください。バージョンはボードのNyBoard上のロゴの横に記載されています。
{% endhint %}

{% hint style="warning" %}
&#x20;シリアルモニタを開き、"**No line ending**"と"**115200 baud**"となっていることを確認してください。
{% endhint %}

![](/files/-MShkpvFy_DRFgZQok20)

{% hint style="warning" %}
NyBoard上のダイアルスイッチがPiではなく、**Arduino**になっていることを確認してください。
{% endhint %}

WriteInstinc.inoをAruduino IDE上でマイコンボードに書き込み（アップロード）後、シリアルモニタを開いてください。開くと以下のような文言が出てきます。

`Reset all joint calibration? (Y/n)`

初めてPetoi Bittleで遊ぶ方は”**Y**”と入力してください。

`Do you need to update Instincts? (Y/n)`

”**Y**”と入力してください。

`Calibrate MPU? (Y/n)`

”**Y**”と入力してください。

プログラムが停止した場合はシリアルモニタを閉じ、NyBoard上のリセットボタンを押して再度試してください。

![](/files/-MSh-nDLIxl-xTx71sT1)

### 6.1.3. OpenCat.inoをアップロードする。

上記動作を終了後、**OpenCat.ino**をアップロードしてください。

## 6.2 キャリブレーション

### 6.2.1 リモートコントローラーでキャリブレーションを行う場合

バッテリーとサーボが正しく接続されていることを確認してください。

サーボのギア部分には何も接続しない状態にしてください。

![](/files/-Mbe39LVG50R-jtLqWqr)

### 6.2.2頭と足のキャリブレーション

リモコン上の"**EQ**"ボタンを押してください。

モーターが動いたのを確認後、作成した腕部分の黄色いサイドを肩のサーボに接続してください。体に対して垂直になるように装着してください。

{% hint style="warning" %}
装着中にサーボを回転させないように注意してください。
{% endhint %}

前腕部分も同様に先に装着した腕に対して垂直になるように接続してください。

![](/files/-MTM-Wj1EMpq0cuCaH_W)

![校正モードに入ったときの完全なゼロ（校正済み）の状態を視覚化したもの](/files/-MShIq30YZzgSftJv-8O)

同封されているL字のチューナーを用いて適切に接続できているか確認してください。

![](/files/-MTM-Wix0_6MMzanPSDh)

次に、ヘッドサーボの出力軸をネックのサーボアームに差し込みます。頭はなるべくまっすぐ前を向くように接続してください。

### 6.2.3 テストと検証

Bittleの体を空中に浮かせます。 IR remote controllerの 「1」ボタンを押して、Bittleに数回の "ストレッチ "をさせ、手足の動きに問題がないかを確認します。 直感的に動いているようであれば、平らな床の上に置いてください。 IR remote controllerのアクションボタンを何度か押して、Bittleを動かし、動きに違和感がないかを確認します。 その後、「EQ」ボタンを押すとキャリブレーションモードに戻ります。 上肢と下肢が直角になっているか、下肢が地面と平行になっているかを観察します。 足と頭の位置が合っていれば、マイナスネジを使って手足と頭をサーボに固定します。 そうでない場合は、手足を外して何度かキャリブレーションを繰り返します。 どうしてもうまくいかない場合は、6.3のより正確なキャリブレーションを行う必要があります。

## 6.3 より正確なキャリブレーションを行う

### 6.3.1 初期位置と座標について

初期位置はサーボ可動域の中央の場所として定義されています。

キャリブレーションモードに入るとすべてのサーボが初期位置に戻ります。脚部に関しては反時計回りの方向が正の向きとなります。

![校正モードに入ったときの完全なゼロ（校正済み）の状態を視覚化したもの](/files/-MShIq30YZzgSftJv-8O)

ペトイビトルで使用してるサーボには25個の歯があるので、1つの歯はおよそ14.4度となります。つまり、正確に90度にはなりません。

![](/files/-MTM-Wiv6R3xuNmAhgrE)

### 6.3.2 Understand the serial outputs via software-based calibration&#x20;

Arduino IDEを用いたキャリブレーションは**WriteInstinct.ino**または**OpenCat.ino**のファイルで実行可能ですが、WriteInstinct.inoのファイルで実行することを推奨しています。

WriteInstinct.inoまたはOpenCat.inoのファイルをアップロードしてください。そしてシリアルモニターを開き"**c**"を入力してください。

入力後サーボが初期位置まで戻ります。サーボが初期位置に戻ると本体からビープ音が鳴り、以下のような表が表示されます。

![](/files/-MSh0lbkraeOQAbsPTqw)

1列目はジョイントインデックス、2列目はキャリブレーションのオフセットを表しています。

| **Index**  | 0  | 1  | 2  | 3  | 4  | 5  | 6  | 7  | 8  | 9  | 10 | 11 | 12 | 13 | 14 | 15 |
| ---------- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
| **Offset** | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 |

### 6.3.3 Arduino IDEを用いたキャリブレーション

NyBoardにおけるキャリブレーションのフォーマットは"cIndex Offset"です。また、それぞれの部位に対応するインデックスは以下の図の通りです。

![Joint Indexes](/files/-MShe8Oogbo5SCF0YULN)

例

* "c8 6"と入力した場合８と割り振られたサーボが6度反時計回りに回転します。

{% hint style="info" %}
オフセットの値が９以上になる場合はサーボを回転させないように一回取り外してください。そして、体に対して垂直になるように接続しなおして下さい。これによりオフセットの値がちいさくなります。
{% endhint %}

### 6.3.4 L字型接続チューナー

キャリブレーションが正確に行われたか確認するために付属の接続チューナーを下図のようにあわせてください。

![](/files/-MSGx1sAobtzY1ucuddF)

![上の脚を先に揃えて下さい](/files/-MUqkKuaRpRGekAM5g5s)

![下脚の土台となるのでエッジには細心の注意を](/files/-MUqkKucrcObDMp-mFaa)

キャリブレーション終了後、"**s**"と入力して保存します。保存しないで終了した場合、キャリブレーションのオフセットは適応されないので注意してください。

### 6.3.5 テストと検証

After calibration, type ‘d’ or ‘kbalance’ to validate the calibration. It will result in Bittle symmetrically moving its limbs between rest and stand state. &#x20;

Please refer to the previous testing & validation section for the process.

You may need to do a few rounds of calibrations to achieve optimal states.

キャリブレーション後、「d」または「kbalance」と入力してキャリブレーションを検証します。これによりBittleは静止状態と起立状態の間で左右対称に手脚を動かすことになります。&#x20;

このプロセスについては、前のテストと検証のセクションを参照してください。&#x20;

最適な状態にするためには、何度かキャリブレーションを繰り返す必要があるかもしれません。

### 6.3.6 重心

Try to understand how Bittle keeps balance even during walking. If you are adding new components to Bittle, try your best to distribute its weight symmetrically about the spine. You may also need to slide the battery holder back and forth to find the best spot for balancing. Because the battery is heavier in the front, you can also insert it in a reversed direction to shift the center of mass more towards the back.&#x20;

Bittleが歩行中どのようにバランスを保っているかを理解してください。新しい部品を追加する場合は、背骨を中心に重さが対称になるように工夫してください。また、電池ホルダーを前後にスライドさせて、バランスをとるのに最適な場所を探す必要があるかもしれません。電池は前の方が重いので、逆に差し込んで重心を後ろに移動させることもできます。

You may need to recalibrate if there's a change to the center of mass.&#x20;

重心に変化があった場合は、もう一度キャリブレーションが必要になります。

## 6.4 仕上げ

### 6.4.1 頭部

To lock in the head, use an M2x4 flat head screw to lock the servo shaft and the servo arm from the bottom side of the chassis.

頭部を固定するには、M2x4の平頭ネジを使って、サーボ軸とサーボアームをシャシーの下側から固定します。

![](/files/-MTM-WiyBxOE5IDu7e1m)

### 6.4.2 手脚

キャリブレーションが終了したらサーボの回転部分をネジで固定してください。

![](/files/-MTM-Wj2kcwawLA6Pbco)

### 6.4.3 ワイヤーシールド

ワイヤーシールドを装着する際は向きがあるので注意してください。挿入した際に脚部と平行になるのが正しい向きです。

![](/files/-MTM-Wj461gAyTf7AkNx)

![](/files/-MTM-Wj5d_LcIZoYLlho)

下の図は間違った装着例です。

![](/files/-MTM-Wj68-m3NOLl4kd-)

### 6.4.4 ボディーカバーと尻尾

The 6-pin female socket is used for connecting the programmer and communication dongles. Carefully bend it forward in a smooth arc if you are not going to attach a Raspberry Pi.&#x20;

6ピンの雌ソケットは、プログラマーや通信ドングルの接続に使用します。Raspberry Piを取り付けない場合は、慎重に滑らかな弧を描くように前に曲げてください。

![](/files/-MTM-Wj3VPeoNIJpK3eL)

![](/files/-MTM-Wj7bzLX7TleB59J)

![](/files/-MTM-Wj8c1oHVy8Kte9v)


# 7 🕹 遊び方

"You can't direct the wind, but you can adjust your sails." ⛵️

## 7.1. Control with Arduino IDE

Try the following serial commands in the serial monitor:

* “**k**sit”
* “**m**0 30”
* “**m**0 -30”
* “**k**balance”
* “**k**wkF”
* “**k**trL”
* “**d**”

{% hint style="warning" %}
The quotation mark just indicates that they are character strings. Don’t type quotation marks in the serial monitor.
{% endhint %}

## 7.2. Control with Infrared remote

### 7.2.1. Keymap

Only the position of the buttons matters, though those symbols can help you remember the functionalities. I’m going to define position related symbols to refer to those keys.&#x20;

I’m using abbreviations for key definitions to reduce SRAM usage. Due to the limited keys of a physical remote, I always change the definitions for fun.&#x20;

{% hint style="warning" %}
The following map is just an illustration. Check **OpenCat.h** for the actual key definitions in effect. They are also open to your customization.
{% endhint %}

![](/files/-MShO-T6PybOi1QgoVvx)

### 7.2.2. Check out the following featured motions

* **Rest** puts the robot down and shuts down the servos. It's always safe to click it if Bittle is doing something **AWKWARD**.&#x20;
* **Gyro** will turn on/off the gyro
* **Balance** is the neutral standing posture. You can push Bittle from the side, or make it stand up will hind legs and tail. You can test its balancing ability on a fluctuating board. Actually balancing is activated in most postures and gaits.
* Pressing **F/L/R** will make the robot move forward/left/right
* **B** will make the robot move backward
* **Calibrate**  puts the robot into calibration posture and turns off the gyro
* **Stepping** lets the robot step at the original spot
* **Crawl/walk/trot/run** are the gaits that can be switched and combined with the direction buttons
* Buttons after **bound** are preset postures or other skills
* Turning off the gyro can accelerate and stabilize the slower gaits. But it’s NOT recommended for faster gaits such as run and bound.&#x20;
* Different surfaces have different friction and will affect walking performance. The current trained parameters work better without the silicone toe covers. They are provided for your experiments. The carpet will be too bushy for Bittle's short legs. It may only crawl (command **kcrF**) over this kind of tough terrain.&#x20;
* You can pull the battery pack down and slide along the longer direction of the belly. That will tune the center of mass, which is very important for walking performance. Otherwise, it may keep falling down.
* When Bittle is walking, you can let it climb up/down a small slope (<10 degrees)
* Whatever Bittle is doing, you can lift it vertically, and it will stop moving, just like a dog scruffed on the neck.

{% hint style="info" %}

* If Bittle keeps beeping after you connect the USB uploader, with numbers printed in the serial monitor, it’s the low voltage alarm being triggered. You need to power NyBoard with the battery to pass the threshold.
* The servos are designed to be driven by internal gears. Avoid rotating the servos too fast from outside.&#x20;
* **Don’t keep Bittle running for too long.** It will overheat the electronics and reduce the servos’ life span.&#x20;
* If you feel something is wrong with Bittle, press the reset button on NyBoard to restart the program.&#x20;
* Bittle has acrophobia! If you lift it and rotate it over a certain degree, its current movement will be interrupted. Don't flip Bittle over to scare it!&#x20;
* Be kind as if you were playing with a real dog. (^=◕ᴥ◕=^)
  {% endhint %}


# 8 👨‍🏫 Bittleに新しいスキルを教える

"Give a cat a fish and you feed it for a day. Teach a cat to fish and you feed it for a lifetime." 🎣

## 8.1. InstinctBittle.hのスキルを理解する

![](/files/-MShXLD0m-KEbPSKhaTi)

EEPROMの書き込み操作回数は1,000,000回と限られています。そのため、EEPROMへの書き込み操作を最小限にしたいと考えています。

スキルには「Instincts」と「Newbility」の2種類あります。両者のアドレスはルックアップテーブルとして搭載されたEEPROM（1KB）に書き込まれていますが、実際のデータは別のメモリに格納されています。

* **Instincts**はI2CのEEPROM（8KB）に格納されています。

Instinctsは、初期搭載されたスキルのことです。例えるなら「マッスルメモリー」のようなものです。複数のInstinctsは、**WriteInstinct.ino**を使って一度だけI2C EEPROMに書き込まれます。それらのアドレスは、**WriteInstinct.ino**実行中に生成され、オンボードEEPROMのルックアップテーブルに保存されます。

* PROGMEM（32KBのフラッシュをスケッチで共有）は**Newbility**を格納します。

Newbilityとは、多くのテストを必要とする新たな実験的スキルのことです。I2CやオンボードEEPROMに書き込まれるのではなく、PROGMEM形式のフラッシュメモリーに書き込まれます。Arduinoのスケッチの一部としてアップロードする必要があります。そのアドレスはコードの実行時にも割り当てられますが、スキルの総数（すべてのInstinctsとNewbilitiesを含む）が変わらなければ、その値が変わることはほとんどありません。

## 8.2. InstinctBittle.hの例

```cpp
//a short version of InstinctBittle.h as example

#define BITTLE
#define NUM_SKILLS 4
#define I2C_EEPROM

const char rest[] PROGMEM = { 
1, 0, 0, 1,
  -30, -80, -45,   0,  -3,  -3,   3,   3,  75,  75,  75,  75, -55, -55, -55, -55,};
const char zero[] PROGMEM = { 
1, 0, 0, 1,
    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,};

const char crF[] PROGMEM = { 
36, 0, -3, 1,
  61,  68,  54,  61, -26, -39, -13, -26,
  66,  61,  58,  55, -26, -39, -13, -26,
  ...
  51,  81,  45,  72, -25, -37, -12, -25,
  55,  76,  49,  68, -26, -38, -13, -26,
  60,  70,  53,  62, -26, -39, -13, -26,
};

const char pu[] PROGMEM = { 
-8, 0, -15, 1,
 6, 7, 3, 
    0,   0,   0,   0,   0,   0,   0,   0,  30,  30,  30,  30,  30,  30,  30,  30,	 5, 0,
   15,   0,   0,   0,   0,   0,   0,   0,  30,  35,  40,  29,  50,  15,  15,  15,	 5, 0,
   30,   0,   0,   0,   0,   0,   0,   0,  27,  35,  40,  60,  50,  15,  20,  45,	 5, 0,
   15,   0,   0,   0,   0,   0,   0,   0,  45,  35,  40,  60,  25,  20,  20,  60,	 5, 0,
    0,   0,   0,   0,   0,   0,   0,   0,  50,  35,  75,  60,  20,  30,  20,  60,	 6, 0,
  -15,   0,   0,   0,   0,   0,   0,   0,  60,  60,  70,  70,  15,  15,  60,  60,	 6, 0,
    0,   0,   0,   0,   0,   0,   0,   0,  30,  30,  95,  95,  60,  60,  60,  60,	 6, 1,
   30,   0,   0,   0,   0,   0,   0,   0,  75,  70,  80,  80, -50, -50,  60,  60,	 8, 0,
};

#if !defined(MAIN_SKETCH) || !defined(I2C_EEPROM)
const char* skillNameWithType[] =
{"crI", "puI", "restI", "zeroN",};
const char* progmemPointer[] = 
{cr, pu, rest, zero, };
#else
const char* progmemPointer[] = {zero};
#endif
```

### 8.2.1. 定義された定数

`define WalkingDOF 8`&#x20;

これは歩行のための自由度（DOF）の数値を定義しており、Bittleでは8となっています。

`define NUM_SKILLS 4`

スキルの合計数が4であることを定義しています。これはリストの項目数と同じである必要があります。

`const char* skillNameWithType[]`.

`define I2C_EEPROM`

NyBoardにはInstinctsを保存するためのI2C EEPROMがあることを意味します。

{% hint style="warning" %}
If you are building your own circuit board that doesn’t have it, comment out this line. Then both kinds of skills will be saved to the flash as PROGMEM. Obviously, it will reduce the available flash space for functional codes. If there were too many skills, it may even exceed the size limit for uploading the sketch. &#x20;

それがない回路基板を自分で作成する場合は、この行をコメントアウトしてください。両方のスキルがPROGMEMとしてフラッシュに保存されます。それによって機能コードのための利用可能なフラッシュのスペースが減ります。スキルの数が多すぎると、スケッチをアップロードする際のサイズ制限を超えてしまうことがあります。
{% endhint %}

### 8.2.2. スキル配列のデータ構造について

関節角度の1フレームは静止した**姿勢**を定義し、一連のフレームは**歩行**や**動作**などの連続した姿勢を定義します。次の2つの例をご覧ください：

```cpp
const char rest[] PROGMEM = { 
1, 0, 0, 1,
  -30, -80, -45,   0,  -3,  -3,   3,   3,  75,  75,  75,  75, -55, -55, -55, -55,};

const char crF[] PROGMEM = { 
36, 0, -3, 1,
  61,  68,  54,  61, -26, -39, -13, -26,
  66,  61,  58,  55, -26, -39, -13, -26,
  ...
  51,  81,  45,  72, -25, -37, -12, -25,
  55,  76,  49,  68, -26, -38, -13, -26,
  60,  70,  53,  62, -26, -39, -13, -26,
};

```

以下のようなフォーマットとなっています：

![](/files/-MShaXnFcM6qIR7ghH0Z)

**rest**は静止した姿勢で、16個ある関節角のうち、1フレームしかありません。**crF**は "crawl forward "の略です。8個（歩行DOF数によっては12個）の関節角で36フレームを構成し、反復歩行を形成します。期待される体勢は、ロボットがスキルを行っているときの体の角度を定義します。予想される角度から体が傾いている場合、バランシング・アルゴリズムがいくつかの調整を計算します。角度比は、-128～127の範囲よりも大きな角度を保存したい場合に使用します。比率を2に変更すると、大きな角度を2で割って保存することができます。

{% hint style="info" %}
姿勢については1つのフレームしかなく、歩行には複数のフレームがあり、ループしていきます。
{% endhint %}

以下は動作の例です：

```cpp
const char pu[] PROGMEM = { 
-8, 0, -15, 1,
 6, 7, 3, 
    0,   0,   0,   0,   0,   0,   0,   0,  30,  30,  30,  30,  30,  30,  30,  30,	 5, 0, 0, 0,
   15,   0,   0,   0,   0,   0,   0,   0,  30,  35,  40,  29,  50,  15,  15,  15,	 5, 0, 0, 0,
   30,   0,   0,   0,   0,   0,   0,   0,  27,  35,  40,  60,  50,  15,  20,  45,	 5, 0, 0, 0,
   15,   0,   0,   0,   0,   0,   0,   0,  45,  35,  40,  60,  25,  20,  20,  60,	 5, 0, 0, 0,
    0,   0,   0,   0,   0,   0,   0,   0,  50,  35,  75,  60,  20,  30,  20,  60,	 6, 0, 0, 0,
  -15,   0,   0,   0,   0,   0,   0,   0,  60,  60,  70,  70,  15,  15,  60,  60,	 6, 0, 0, 0,
    0,   0,   0,   0,   0,   0,   0,   0,  30,  30,  95,  95,  60,  60,  60,  60,	 6, 1, 0, 0,
   30,   0,   0,   0,   0,   0,   0,   0,  75,  70,  80,  80, -50, -50,  60,  60,	 8, 0, 0, 0,
};
```

**pu**は「push up」の略で、「動作」のことです。このデータ構造は、姿勢や歩行よりも多くの情報を含んでいます。

最初の4つの要素は、動作であることを示すためにフレーム数が負の値として保存されていることを除いて、前と同じように定義されています。次の3つの要素では、シーケンス内の繰り返しフレームを定義します：開始フレーム、終了フレーム、ループサイクルです。つまり、例の6, 7, 3は、行動が7番目のフレームから8番目のフレームまでを3回ループすることを意味します（インデックスは0から始まります）。歩行のようにループするのではなく、行動の配列全体が1度だけ実行されます。

各フレームには16個の関節角が含まれており、最後の4つの要素では、トランジションの速度と各トランジション後の遅延条件が定義されています。

1. デフォルトの速度係数は4ですが、1（遅い）から127（速い）までの整数に変更できます。単位は 1 ステップあたりの度数です。0に設定すると、サーボの最大速度で目標の角度まで回転します（約0.07秒/60度）。リスクを理解していない限り、10 以上の値を使用することはお勧めできません。&#x20;
2. 遅延時間の初期値は0ですが、0～127まで設定でき、単位は50msです。&#x20;
3. 3つ目の数値はトリガー軸です。0でない場合は、前の遅延時間は無視されます。次のフレームのトリガーは、対応する軸のボディの角度に依存します。ピッチ軸には1、ロール軸には2を指定します。数字の符号は閾値の方向、つまり現在の角度がトリガーの角度よりも小さいか大きいかを定義します。&#x20;
4. 4つ目の数値はトリガー角度です。128度から127度の範囲で設定できます。

### 8.2.3. 本能を示すサフィックスと優れたポイント

初めて**EEPROM**にスキルを書き込ませるには、**WriteInstinct.ino**をアップロードする必要があります。以下の情報が使用されます。

```cpp
const char* skillNameWithType[] =
{"crI", "puI", "restI", "zeroN",};
const char* progmemPointer[] = 
{cr, pu, rest, zero, };
```

{% hint style="info" %}
スキル名の文字列には、IまたはNというサフィックスが付いていることに注意してください。これは、スキルデータをどこに保存するか、いつそのアドレスを割り当てるかをプログラムに伝えるものです。
{% endhint %}

その後、アップロードされたスケッチがメインスケッチのOpenCat.inoであり、I2C EEPROMを搭載したNyBoardを使用している場合、プログラムはNewbilityリストへのポインタのみを必要とします。

`const char* progmemPointer[] = {zero};`

を使って、あらかじめ定義されたスキルの完全な知識を引き出すことができます。

## 8.3. 新しいスキルや行動を定義する

### 8.3.1既存のスキルテンプレートの変更

すでにInstinctBittle.hには "zeroN "というスキルが存在しています。

まずmndex Offsetというコマンドで個々の関節を目標の位置に移動させてから、配列の中の関節角度（太字フォント）を一度に置き換えることができます。

```cpp
const char zero[] PROGMEM = { 
1, 0, 0, 1,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,};
```

Newbilityとして宣言されており、I2C EEPROMに書き込む必要がないため、配列を変更するたびにOpenCat.inoをアップロードするだけでよい（WriteInstinct.inoをアップロードしなくてもよい）。IRリモコンの7>を押すか、シリアルモニタにkzeroと入力することで、新しい姿勢を引き起こすことができます。

このスキルの名前は変更できますが、IRリモートのキーマップを更新することを忘れないでください。

### 8.3.2. Add more skills in InstinctBittle.h

InstinctBittle.hでスキルを増やすことができます。ファイルの最初にスキル番号を増やし、スキルリスト配列に対応するスキル名とポインタを追加することを忘れないでください。

スキルはシリアルモニタからトークンの「k」コマンドで呼び出すことができます。例えば、ksitはBittleを姿勢「sit」に動かします。

また、新しいスケッチをアップロードしなくても、m、i、lトークンを使ってシリアルポートから姿勢フレームを送ることで、新しいスキルをチューニングすることができます。スキルを微調整した後は、instinctBittle.hに保存し、newbilityやinstinctとしてボードにアップロードすることができます。

{% hint style="warning" %}
使用可能なスキル名については、必ず実際のコードを確認してください。ソフトウェアを繰り返し開発する中で、スキルセットを変更することがあります。
{% endhint %}

この[git repo](https://github.com/ger01d/kinematic-model-opencat)は、カスタマイズされた歩行を開発したい場合の良い出発点となります。逆運動学の計算を行う場合は、以下の主要なディメンションを使用してモデルを構築することができます。

![](/files/-MUCICLjRZvBg7XSKbFg)

### 8.3.3. Automation

これまでBittleは赤外線リモコンで操作していました。Bittleの行動を決めるのはあなたです。 パソコンやスマートフォンと接続して、自動的に指示を出すことができます。そうすると「Bittle」はその指示に一生懸命従います。&#x20;

また、タッチセンサーなどのセンサーや、ボイスコントロールなどの通信モジュールを追加することで、新しい知覚や判断力を持たせることができます。その自動行動を積み重ねて、最終的には自分で生きていくことができるのです。


# 9 👨‍🎓 OpenCat.hについて

"Let the cat out of the bag." 🧞‍♂️

## 🔬It will make another textbook.&#x20;

新たな教科書を作ることになります。

The controlling framework behind Bittle is OpenCat, which I've been developing for a while. You can read more stories from my [posts](https://www.hackster.io/petoi/opencat-845129) on Hackster.io.

Bittleの背後にある制御フレームワークは、私が以前から開発しているOpenCatです。Hackster.ioに投稿した[記事](https://www.hackster.io/petoi/opencat-845129)から、これに関するストーリーを読むことができます。

![](/files/-MShc6IRKyzRVWzYnJZ8)

It's too much work for now 🤷🏻‍♂️ but you are welcome to discuss it with me on the forum or through email. Good thing is, I will keep the code compatible with future OpenCat models, and even [your own DIY robots](https://www.petoi.com/forum/showcase)! Hopefully, the documentation will be completed during the processes.&#x20;

現在はとても忙しいです🤷🏻‍♂️しかし、フォーラムやメールでのご相談も歓迎します。幸いなことに、このコードは将来のOpenCatモデルや[あなたのDIYロボット](https://www.petoi.com/forum/showcase)との互換性を保つつもりです。プロセス中にドキュメントを完成できればと思います。


# 10🔩 コードクラフトと拡張パック

## コードクラフトの使い方

**ペトイビトルのボードのカバーを外し、付属のUSBアダプターのチップを対応するピン穴に差し込みます。**

[**https://ide.tinkergen.com**](https://ide.tinkergen.com)

**上記のウェブサイトにアクセスし”Bittle”をクリックします。**<br>

![](https://lh5.googleusercontent.com/4ShoWiGIWmMhW6Z7969qFrq7Kaw9Qq_NsLqPVGXZ2HgLPI_brIKcyjgvUF9qEpEx9ZHnVVIpfCUzNhh3qP5p2TqDJWw3vBfdBc2X-UJgY5mfj36HdZf38w5OAiCTVq7IXLTDzPWt)

1. **“Device Assistant”をダウンロードする**

Codecraftを初めて利用される方は”Device Assistant”が必要になります。”Connect”を押すと下記のような画面が表示されるので”Download Device Assistant”をクリックします。

![helloworld-3-2.png](https://lh4.googleusercontent.com/4i2BzqKw6Lsu_85V7KPbZnjYc2xasY5DsipEb4bSI0g2c1ctmkVNCcfF0tvRayA0PT-LJ1owwIsDBmUtakhwRp0fU4aYl1Qew87Dd4M1GsiBo8cShabGjuIQ9BpP9Kt0-z1fFr7T)

インストールが完了後、フクロウのアイコンをクリックして起動します。起動させたら、再度”Connect”をクリックし自分で組んだコードをアップロードして完了です。

デバイスを繋ぐ際には「USBドングルを接続する」で選択したデバイスを選んでください。

![hw\_3\_4.png](https://lh4.googleusercontent.com/bWvPVUQS01Hhz552uVhujsOzF52cCBbNJqp6_KrWGxacbzp_buvC-Yc6lkN96Ab2qYgbcf8_WFtQ24iJX9OGjUfFnZq3HBXWdZtWHUHy-wtqpB7NvK82czJipDQGnlRj-q7n6wl7)

GitHubのコードとCodeCraftのコードにはバージョンが異なるため動作をうまく行えません。CodeCraftで行う場合は一度コードクラフトのスキルをアップデートする必要があります。

![](https://lh6.googleusercontent.com/BJn24ehSc8AWha8IH9vj8iStH-jivC37INV6f1Y1sLhKXsViRypgU-D6X3-NitNrc-v6Vy8alOteUD2Ivh2dxEWF3kq5EWkvr4GdpEBizW5Ld3BjwTvFN9dYP_r1VZHkS096K4Ah)

\
\
\ <br>

**・Touch Sensorを使う場合**

**下記の写真のようにセンサーをDigitalソケットに接続する。**

![](https://lh4.googleusercontent.com/OkrPsGfq8hieTCRLbTxrEqJz0hMCJWozbIJ4RrZ6Vq2b3QdIzROLSzMsfgDAvq4anZWfcL0HROs9E4CKXQMWd5-nvudMljP7N81rknVp_5Q_N9dqqgW5jsGREhhSb2ZVxJIq06Qc)

**Digitalソケットに接続**<br>

**コード例**

![](https://lh5.googleusercontent.com/QkIiBvXaCiv3WGbSKAEo8Mb-fkcFsYfPPYqQlN0TuUS4-HXd3qh5_FyxcJLT39ZANQdppPejY_KCX_s9plTw95Es30P4KmBCFTG_j2MKq-6LeKcWfRukhjzE496OWvRAm7IuVdji)

**Sound Sensorを使う場合**

Analogソケットに接続

![](https://lh5.googleusercontent.com/Ay99oMHFTvd9Kef6OxNTKZr1FcfCfwyn6haOcjIQn38TdRE4R6iEmi-rgqLaQdoYdW74WoY-1llG9-5XANETw7RmgqZmLNrIXKdTn6JsDPtiUhWnVjQ1xUHZ6QgorjVap6nI96yu)

**コード組合せ例**<br>

![2-2.png](https://lh5.googleusercontent.com/RQOUjo3KNBbyfLvWVyGK3upsj46P7fPbZW6wLcAFCLTli-hU7H7S_4wEgOLyHGgEEU34In8I-bGEGVCwUwjz5bf-uwOLNRgL0N1oMXnhqBes6ovVx6MImY1ekoiHyOq1dXnTBX_w)

**・Digital PIR Sensorを使う場合**

**Digitalソケットに接続**

![](https://lh4.googleusercontent.com/OkrPsGfq8hieTCRLbTxrEqJz0hMCJWozbIJ4RrZ6Vq2b3QdIzROLSzMsfgDAvq4anZWfcL0HROs9E4CKXQMWd5-nvudMljP7N81rknVp_5Q_N9dqqgW5jsGREhhSb2ZVxJIq06Qc)

**コード組合せ例**

![](https://lh6.googleusercontent.com/t94HF_4OVkTWp2zAIEc-lEUkZezFqWZq9HSm9AmoF4rJ2iiV_Aik9eq7i4Rx9MqzzAzvYoCJiQ3xXLBUZ4CS6iYQbYMI6Q9Oh3DfjX3CzGx5Fz4ssRDuHdbQK4eeiQthw_UVaOmw)

**・Intelligent Camera　（Arduino IDEを用いた場合）**\ <br>

下記のURL先の動画を参考にしてください

<https://www.youtube.com/watch?v=CxGI-MzCGWM>

I2Cソケットに接続

![](https://lh4.googleusercontent.com/pKAbAOZsMxyEYW2k6z31av6Joic7TZa8AEBg3eTeL4A3XjYcfbIyJ4_bbnxnpjh4d_q24XJ_Z5sWcwesjas7ToarnoMpfX-fvQheiSD9NAXgoUTjvQmI0_0WGNjmvMMHqyEnW0-t)

カメラにある左から２番目を上にあげる<br>

<https://github.com/petoicamp/balltracking>

からZip Fileをダウンロード<br>

Zip Fileを展開して”BallTracking-main”を”BallTracking”に変更<br>

<https://github.com/mu-opensource/MuVisionSensor3>

Zip Fileをダウンロード<br>

Sketch>Include Library>add zip fileからダウンロードしたファイルを選択<br>

WriteInstinctをアップロードしてシリアルモニターを開きYを三回

終了後

Ball Trackingをアップロード

（緑色の球体を追跡します）テニスボールなど<br>

The head of Bittle is designed to be a clip to hold extensible modules. We compiled a sensor pack with some popular modules, but its contents may change in the future. You can also wire other add-ons thanks to the rich contents of the Arduino and Raspberry Pi community.&#x20;

You can find the demo codes of these modules in our GitHub repository. They should be in the [ModuleTests](https://github.com/PetoiCamp/OpenCat/tree/main/ModuleTests) folder if you download the whole OpenCat repository.

![](/files/-MTkh0ikD4iSFKbcvnhD)

The loudness and light level modules can generate [analog readings](https://github.com/PetoiCamp/OpenCat/tree/main/ModuleTests/test_Loudness_Light) for the corresponding signals and should be connected to the analog Grove socket.&#x20;

&#x20;<img src="/files/-MTkekrdmpctYn5M4Csl" alt="" data-size="original">[Grove - Sound Sensor/ Noise Detector](https://www.seeedstudio.com/Grove-Loudness-Sensor.html)

<img src="/files/-MTkfj1_auKstc9phHen" alt="" data-size="original">[Grove - Light Sensor v1.2 - LS06-S phototransistor](https://www.seeedstudio.com/Grove-Light-Sensor-v1-2-LS06-S-phototransistor.html)

The touch, reflection, PIR sensors can generate digital 1 or 0 as a switch signal. So they should be connected to the digital Grove socket. In the [demo code](https://github.com/PetoiCamp/OpenCat/tree/main/ModuleTests/test_Touch_Reflection_PIR), we use the fourth socket with D6 and D7.

&#x20;<img src="/files/-MTkfj1aKcwqe4n7chcR" alt="" data-size="original">[Grove - Touch Sensor](https://www.seeedstudio.com/Grove-Touch-Sensor.html)

<img src="/files/-MTkeksMqH4y4phrhoWY" alt="" data-size="original">[Grove - Infrared Reflective Sensor v1.2](https://www.seeedstudio.com/Grove-Infrared-Reflective-Sensor-v1-2.html)

<img src="/files/-MTkfj1ZGXfBFaMbin-6" alt="" data-size="original">[Grove - mini PIR motion sensor](https://www.seeedstudio.com/Grove-mini-PIR-motion-sensor-p-2930.html)

The [intelligent camera](https://github.com/PetoiCamp/BallTracking), [gesture](https://github.com/PetoiCamp/OpenCat/tree/main/ModuleTests/testGesture), and [OLED](https://github.com/PetoiCamp/OpenCat/tree/main/ModuleTests/testOLED) module should be connected to the I2C Grove socket.&#x20;

<img src="/files/-MTkfj1ctrfzb02nbn4J" alt="" data-size="original">[Grove - Gesture Sensor for Arduino (PAJ7620U2)](https://www.seeedstudio.com/Grove-Gesture-PAJ7620U2.html)

<img src="/files/-MTkfj1bXWQ2QGWhNqql" alt="" data-size="original">[Grove - OLED Display 0.96" (SSD1315)](https://www.seeedstudio.com/Grove-OLED-Display-0-96-SSD1315-p-4294.html)

<img src="/files/-MTkhSA4WxsWqhuvfMHC" alt="" data-size="original"> [MU Vision Sensor 3](http://store.morpx.com/page.php?a=sensor-support)

* [documentation](https://morpx-docs.readthedocs.io/en/latest/MUVS3/introduction.html#)
* [advanced user manual](https://drive.google.com/file/d/17ompJD5xtAi-hQEoZwoFsK_VIz4LaZ6I/view?usp=sharing)


# サポートするアプリケーションとソフトウェア

## Programming Language Support プログラミング言語サポート

* Coding can be done in C-style language with the [Arduino IDE](https://www.arduino.cc/en/software).&#x20;
* [Python API for sending serial commands](https://github.com/PetoiCamp/OpenCat/tree/main/serialMaster)
* Bittle can be programmed with a Scratch-like web-based IDE [Codecraft](http://ide.tinkergen.com/) and [curriculum](https://www.yuque.com/tinkergen-help-en/bittle_course)
* [Arduino IDE](https://www.arduino.cc/en/software/)を使ってC言語でコーディングが可能&#x20;
* [シリアルコマンド送信用Python API](https://github.com/PetoiCamp/OpenCat/tree/main/serialMaster)
* バイトルはScratchのようなウェブベースのIDEである[Codecraft](https://ide.tinkergen.com/)と[curriculum](https://www.yuque.com/tinkergen-help-en/bittle_course)でプログラムすることができます。

## 3rd-Party Code & Robots - Open-source Robot Controller App - サードパーティCode & Robots - オープンソースのロボットコントローラーアプリ

[The Code & Robots iOS app](http://www.codeandrobots.com/) can control a few open source Robots, include Bittle.[iOSアプリ「Code & Robots」](http://www.codeandrobots.com/)では、「バイトルは」をはじめとするいくつかのオープンソースロボットを操作することができます

Please check out the following video for the app configuration to support controlling Bittle.バイトルの制御に対応するためのアプリの設定については、以下の動画をご覧ください。

{% file src="/files/-MXnjCk\_8Ss2nnoEuFRO" %}
Code & Robots app configuration for supporting Bittle
{% endfile %}

## 3rd-party Open-source Projects

* [Inverse Kinematic Model OpenCat](https://github.com/ger01d/kinematic-model-opencat)
  * [a discussion thread](https://www.petoi.com/forum/software/kinematic-model-of-nybble-and-bittle)
* [OpenCatWeb](https://github.com/leukipp/OpenCatWeb) - a web interface to control Opencat-based robots
  * need to mount a Raspberry Pi
  * [a discussion thread](https://www.petoi.com/forum/software/web-api-to-control-nybble-opencatweb) by the author leukipp


# FAQ

## Do you have any curriculum?

Our partner TinkerGen provides a [curriculum](https://www.yuque.com/tinkergen-help-en/bittle_course) which can be used with its a Scratch-like web-based IDE [Codecraft](http://ide.tinkergen.com/).

## What do different sounds from the board mean?

## How can I easily install the springs into the upper legs of Bittle?

Please check out [the forum post](https://www.petoi.com/forum/basic-assembly-and-setup/just-got-my-bittle-kit-can-t-install-springs) discussing installing springs with varies tools.


# Petoi Bittle User Manuals 🐶

Rongzhong Li

## Getting started

To keep these instructions simple to use, We are focusing on the assembling rather than an in-depth explanation.&#x20;

![](/files/-M_LOvll0vPoNS7OhIqm)

The small but mighty Bittle has these amazing features:

* Support  **Petoi** **Coding Blocks(block-based Scratch-like), C++, and Python**.
* **Free** [C++](https://www.petoi.com/pages/free-cplusplus-quadruped-robotics-curriculum) and [Petoi Coding Blocks](https://www.petoi.com/pages/free-quadruped-robotics-curriculum-scratch-coding)(block-based Scratch-like) **curriculums**.
* Equipped with NyBoard, a high-performance **Arduino Uno-compatible** development board supporting additional modules for robotics/AI/IoT applications.

If you have specific questions on “why” rather than “how”, please post on our forum at <https://www.petoi.com/forum> or write to <support@petoi.com>.

You can support us by shopping at [www.petoi.com/store](https://bittle.petoi.com/www.petoi.com/store). Our social media (Instagram/Twitter/Facebook/GitHub) account is **@PetoiCamp**. Share your build by tagging **#bittle #petoi #opencat** so that we can repost for you!&#x20;

{% hint style="info" %}
Last Updated: 07/24/2022
{% endhint %}


# 1 🧘‍♂️ Tool and Preparation

"A beard well lathered is half shaved." 🪒

## 1.1 Preparation

Prepare a clean desk and some small boxes to unzip the package. Take a picture of the kit contents in case you lose something later.&#x20;

{% hint style="success" %}
It’s better to work in a room without carpet or textured mosaic. Little screws and springs can magically disappear if dropped onto the ground.&#x20;
{% endhint %}

## 1.2 Tools and accessories

{% tabs %}
{% tab title="Required" %}

| **Tool**                       | **Notes**                                                                                                                                                                                |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Flat and Phillips screwdrivers | For M2 (diameter = 2mm) screws                                                                                                                                                           |
| A Windows/Mac/Linux Computer   | <p>Download <a href="https://github.com/PetoiCamp/OpenCat/releases">Petoi Desktop APP</a></p><p>Install the latest <a href="https://www.arduino.cc/en/Main/Software">Arduino IDE</a></p> |
| USB charging port              | 5V 1A output should be enough                                                                                                                                                            |
| {% endtab %}                   |                                                                                                                                                                                          |

{% tab title="Optional" %}

| **Tool**                      | **Note**                                              |
| ----------------------------- | ----------------------------------------------------- |
| Soldering iron w/ accessories | For modifying the PCB if you are a hacker!            |
| 3D printer w/ accessories     | Add your special design                               |
| Arduino/Raspberry Pi kit      | Add more gadgets to Bittle                            |
| Multimeter                    | Test and debug                                        |
| Oscilloscope                  | Test and debug                                        |
| Hot glue/super glue           | Avoid using them. Bittle is designed to be glue-free! |
| {% endtab %}                  |                                                       |
| {% endtabs %}                 |                                                       |


# 2 🧩 Open the Box

"life is like a box of Bittle." 🔍

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

## 2.1 Pre-assembled Bittle

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

{% hint style="info" %}
Video timeline:&#x20;

00:12 Install the neck&#x20;

01:28 Install the battery&#x20;

02:05 Bend the legs&#x20;

03:15 Open the back cover&#x20;

04:07 Insert the Bluetooth dongle (only for models with NyBoard)&#x20;

05:05 Connect the mobile app
{% endhint %}

If you received the pre-assembled Bittle, you need to insert the neck into the body and **bend the knees to natural angles**. Drag the curly wire from the knee side to the shoulder side to avoid squeezing when the knee joints rotate. Put the joints into the following posture before turning on the power.&#x20;

![Pay attention to the direction of the head and the joints](/files/qExU1IsJ6XGFsytJQ3Ik)

**Long press** the battery's button for 2\~3 seconds to power on/off. **Unplug the insulation sheet** of the infrared remote's battery, then you can [control Bittle to move](https://docs.petoi.com/infrared-remote/remote-controller). The robot will keep pausing its movements with beeping sounds when the battery is low. Then, you need to [charge the battery](https://docs.petoi.com/technical-support/battery) with a 5V micro-USB cable. Considering safety, the battery won't supply power during charging.&#x20;

![](/files/-MSmyAEyBm8iJJ42uyMK)

{% hint style="warning" %}
If your Bittle's lower leg is in the right direction but doesn't move when calibrating, you may rotate it in the right direction. You should feel moderate resistance until the joint locks at the right position. The cause is that the new gears are a little too tight, and the large bootup resistance will trigger the protection algorithm. The servo will reduce the force on the joint to avoid overcurrent, which will stop the joint from moving.
{% endhint %}

### **Buzzer beep meaning:**

{% hint style="info" %}
\[1].  The startup melody in normal mode starts at **00:13** in the video below.

\[2]. The repetitive melody starts at **00:21** in the video below.

{% embed url="<https://www.youtube.com/watch?v=DrSsbd84ryo>" %}
{% endhint %}

<table><thead><tr><th width="199.10714285714286">Sound type</th><th>Occasion</th><th>Explaination</th></tr></thead><tbody><tr><td>Short melody [1]</td><td>Power on or reboot</td><td>The program starts successfully</td></tr><tr><td>Short beep</td><td>During use</td><td>The program receives a command</td></tr><tr><td>Repetitive melody [2]</td><td>During use and pausing the movements</td><td>The battery is low or disconnected</td></tr></tbody></table>

### Mute/Unmute the buzzer beep

For the mainboard - NyBoard, you can mute/unmute the buzzer beep by serial command **b** in the serial monitor.

Please refer to [the instructions](https://docs.petoi.com/arduino-ide/upload-sketch-for-nyboard#id-6.-open-the-serial-monitor) in the Petoi Doc Center for how to open the serial monitor and input the serial command.

You can also use the serial command in the [mobile app](https://docs.petoi.com/mobile-app/controller#mute-unmute-the-buzzer-beep) by creating a single command:

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

You can skip Chapter 3 **Assemble the Frame,** Chapter 4 **Connect Wires**, and Chapter 5 **Board Configuration**. Go to Chapter 6 [**Calibration**](https://bittle.petoi.com/6-calibration) directly. You may need to open Bittle's back cover to insert the Bluetooth dongle.&#x20;

{% hint style="warning" %}
**The pre-assembled Bittle is only coarse-tuned.** You still need to calibrate Bittle's joint servos and final assembly to fine-tune its joints for the best performance.&#x20;
{% endhint %}

{% hint style="warning" %}
Friction plays an important role in dynamic balancing during walking. Though the silicone toe covers (socks) can improve grip, they will also amplify the differences of the unpredictable surface of your test environment. So for regular use, we recommend running Bittle without the socks, unless you can tune the gait or need friction to perform some specific tasks.
{% endhint %}

## 2.2 Bittle Construction Kit

If you order a Bittle Robotics Kit Construction or BIttle STEM Kit Construction, you will build your robot dog. You will learn more about robotics after understanding the design logic behind Bittle. Please move to the next chapter for details.&#x20;


# 3 🏗 Assemble the Frame

"The whole is more than the sum of its parts." 🔩

## 3.1 Start with the Unassembled Kit

You can take a glance at this assembling animation for Bittle.&#x20;

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

Here's a more detailed hands-on tutorial on building Bittle from the kit.&#x20;

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

## 3.2 Step-by-step Instruction

You can finish the following parts then put them together in later chapters.

* Neck
* Body&#x20;
* Upper leg
* Lower leg
* Head
* Shoulder servo&#x20;
* Battery

### 3.2.1 Neck

Materials：

* Neck x 1
* Servo arm x 1
* M2x8 sharp-end self-tapping screws x 2

![](/files/-MTM-WiLiUQ4UqWFshk8)

Put the servo arm in the neck part like the figure below. The teeth of the servo arm should face upward.

![](/files/-MTM-WiMQVG5EHLlMm6T)![](/files/-MTM-WiNrekkfKsoEKhm)

Screw two M2x8 self-tapping screws beside both sides of the servo arm. Don't over tighten the screws.&#x20;

![](/files/-MTM-WiO9OR_VuXkRcNk)![](/files/-MTM-WiPv0UGMcRj7wRs)

Finished:

![](/files/-MTM-WiQF3VPFvoxHVCi)

### 3.2.2 Body&#x20;

{% hint style="info" %}
This part is now fully assembled in our package.
{% endhint %}

Materials:

* Assembled neck x 1
* Chasis x 1
* Front and back plate x 2
* Side shoulder x 2

![](/files/-MTM-WiRJDfVd1N1ikmc)

Recognize the front and back side of the chassis. The location of the two large holes along the center track makes a difference. In our standard configuration, we define the holes to be shifted towards the tail. You can also find a small mark "A1" in the front of the chassis.&#x20;

![](/files/-MTM-WiSqQE_8K3MCTXL)![](/files/-MTM-WiTX24179iptTH6)

Push the back tip of the assembled neck into the slot of the chassis. Then press down the front hook until you hear a snap sound.

![](/files/-MTM-WiUgMBmPHYf55aG)![](/files/-MTM-WiVYNOQNQIpZ2oR)

{% embed url="<https://youtu.be/-QOqweIsHYY>" %}

Insert the chassis into one of the side shoulders.

![](/files/-MTM-WiWzXigZeeiYPid)![](/files/-MTM-WiXtzI_k4VojJz1)

Insert the front or back plate into the side shoulder. There are three tenons on each side of the plate. Insert the two front tenons as one group for better alignment. &#x20;

![](/files/-MTM-WiYOcJPiD0fl7eD)![](/files/-MTM-WiZiJODbAkOt8Fv)

Insert both the front and back plates.&#x20;

![](/files/-MTM-Wi_e-huKvoeamsf)

Plug the other side shoulder to complete the body. Again pay attention to the alignment of the tenons of the front and back plates.

![](/files/-MTM-Wia4vf4B2MOaQSR)

Finished:

![](/files/-MTM-Wibow6VZCJANyUj)

### 3.2.3 Upper leg&#x20;

{% hint style="info" %}
This part has been pre-assembled in batches after 2022.&#x20;
{% endhint %}

It's a little hard to explain well with words. Please refer to the assembling [instruction video at 3:23](https://youtu.be/oJ2Y9hZgCEY?t=203). It requires more skill than force. There's a [forum post](https://www.petoi.com/forum/basic-assembly-and-setup/just-got-my-bittle-kit-can-t-install-springs) discussing installing springs with various tools.&#x20;

![](/files/-McnHWs6mshPrzo8frXi)

### 3.2.4 Lower leg

{% hint style="info" %}
There are five servos with long cables and five servos with short cables. The lower legs all need servos with long cables.
{% endhint %}

Materials:

* P1S servo with **long** cable x 4
* Lower leg piece x4
* M2x8 self-tapping screw x 8

![](/files/-MTM-WicMvS9YEFhmVW2)

Assemble the right leg. Insert the servo into the window. Watch the tutorial video to see the correct direction to fold the wire. The notch on the internal edge is designed to let the wire go through. Use two M2x8 screws to fix the servo onto the lower leg.&#x20;

![](/files/-MTM-WidAJU_AlLwaged)![](/files/-MTM-Wie_uiWMeASHUgs)![](/files/-MTM-Wifgyr_q_pILMpb)

The left leg is opposite to the right leg. However, the front and back legs are identical. So you should make two pairs of legs with opposite configurations.&#x20;

![](/files/-MTM-WigHuB0M6J5iSJU)

### 3.2.5 Head

{% hint style="info" %}
There are five servos with long cables and five servos with short cables. The head needs a servo with a short cable.
{% endhint %}

Materials:

* P1S servo with **short** cable x 1
* Chin x 1
* Skull x 1
* M2x8 self-tapping screw x 2

Put the servo in the chin as shown in the figure. Pay attention to the direction of the servo's wire. After that, install two M2x8 self-tapping screws.

![](/files/-MTM-Wihvko0B8KyoqzV)

Insert the skull into the chin so that it can rotate and bite on small gadgets. I recommend you apply some lubricant to the contact points between the skull and chin.&#x20;

![](/files/-MTM-WiigCEWbC8D08bm)

### 3.2.6 Shoulder servo

{% hint style="info" %}
There are five servos with long cables and five servos with short cables. The upper legs all need servos with short cables.
{% endhint %}

Materials:

* P1S servo with **short** cable x 4
* M2x8 self-tapping screws x 8
* Head (assembled)
* Body (assembled)
* Lower leg (assembled) x 4

Put the head, body, servos, and lower legs like the figure below. Insert the short servo wires through the servo slots on the side shoulders. Pay attention to the direction of the servos carefully and place them in the correct configuration.

Side view:

![](/files/-MTM-WijmZALXT6d5LPm)

Top view:

![](/files/-MTM-WikA3OwjmDF-WiK)

You also need to insert the wire of the head servo into the body.

After confirming all the components ' directions, put the short wire servos into the side shoulders. Pay attention to the directions of the shoulder servos’ output shaft. The long wires of the lower leg servos should be inserted into the opening between the shoulder servo and the shoulder window. Use two M2x8 self-tapping screws to fix each should servo.&#x20;

Repeat the above assembly for the hip servos.

![](/files/-MTM-Wil8VtTgzvbFdNI)

{% hint style="warning" %}
Please note the direction of the shoulder servo:

<img src="/files/UqOVViGkv13XCbMiUihS" alt="" data-size="original">
{% endhint %}

### 3.2.7 Battery

{% hint style="info" %}
The controller board is already fixed on the body in the following picture. You can finish the [Connect Wires](/4-connect-the-wires) chapter and then return here.&#x20;
{% endhint %}

Insert the battery plug into the power socket under the body:

![](/files/-MSGx1rtLeUmpYBaER4X)

Place the battery in the direction shown in the figure below, aligning with the mounting holes:

![](/files/-MSGx1rzdoXzntKmLhd2)

Snap in the battery:

![](/files/-MSGx1s-WJF5fzdpptR1)

While holding down the battery, push it towards the head, and arrange the power cable after the battery snaps into place, as shown in the following figure:

![](/files/-MSGx1s0ooClXKrR9g1Q)

Long-press the button on the battery for more than 3 seconds. If the red light on the battery is on, please charge it until the green light on the battery turns solid before using it. The power supply starts to supply power, and the yellow and blue LEDs on the NyBoard light up at the same time.

![](/files/-MSGx1rudzULpj0l2yWt)


# 4 🔌 Connect the Wires

"Everything is connected." 🤝

## Servo wiring principle

<figure><img src="/files/ndwgzaoPsHyVwzh0XtCh" alt=""><figcaption><p>Observe the wiring pattern on the board</p></figcaption></figure>

{% hint style="info" %}
Note that **NyBoard** has an infrared receiver close to the robot tail, **BiBoard V0** has an infrared receiver close to the robot head, but **BiBoard V1** has **no** infrared receiver.
{% endhint %}


# NyBoard

## Servo wiring

Connect the wires of servos to the NyBoard servo pins as below. They follow a circular symmetry. Notice the skipped indexes between the head and leg servos (1\~7). They are reserved for our future robots with more joints.&#x20;

![NyBoard](/files/ZaOgmRvMzmrhFxRxCFlb)

{% hint style="danger" %}
The index number of the joint servo has **no corresponding relationship** with the PWM PIN on the main board. **You should not read the PINs on the PCB board during assembly.**&#x20;
{% endhint %}

### Wire direction

Please ensure the black wire (or the darkest wire - ground wire) is closest to the board.

![](/files/-MTM-WimcJAGGrjcnrOw)

Bottom view:

![](/files/-MTM-Win_KDbqjJgjyNA)

Insert the infrared receiver under the back plate so the sensor can be exposed to the outside.&#x20;

![](/files/-MTM-Wio4N0I-BzZoewa)

![](/files/-MTM-WipuCZN-A2JuJb8)

Ensure the wires go into the body, bypass the columns, and plug into the servo pins. Arrange the wires so they don't get between the servo plugs and the body frame. NyBoard should fit flat on the four standoffs. (It is OK for the board to have a minor bend caused by the chassis.) Use four M2x8 self-tapping screws to fix the NyBoard. &#x20;

![](/files/-MTM-Wiq2hlW3IXgI7rm)

Completed:

![](/files/-MTM-WirguxJis5un9Fx)

![](/files/-MTM-Wisp_7IuDcaDNJk)

Ensure all the servos are connected to the correct sockets on the circuit board in the proper orientation.&#x20;


# BiBoard V0

## Servo wiring

BiBoard V0(for Bittle X), Please check this page to [identify your BiBoard version](https://docs.petoi.com/desktop-app/firmware-uploader#biboard-version).

Although BiBoard V0 has only 12 pins, the joint index numbers are configured in the same order as  NyBoard. The connection between the joint servo and the pin is shown in the figure below：

<figure><img src="/files/9TdetXg8ciT9YIGhPxzk" alt=""><figcaption></figcaption></figure>

####

#### Wiring instruction for BiBoard V0 with the voice command extension hat

Please ensure the black wire (or the darkest wire - ground wire) is closest to the board.

{% embed url="<https://www.youtube.com/watch?v=0xQcAONvXNA>" %}

Ensure all the servos are connected to the correct sockets on the circuit board in the proper orientation.&#x20;


# BiBoard V1

## Servo wiring

BiBoard V1(for Bittle X V2), Please check this page to [identify your BiBoard version](https://docs.petoi.com/desktop-app/firmware-uploader#biboard-version).

Although the BiBoard V1 has only 12 pins, the joint index numbers are configured in the same order as the NyBoard. The connection between the joint servo and the pin is shown in the figure below：

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

#### Wiring instruction for BiBoard V1

Please ensure the black wire (or the darkest wire - ground wire) is closest to the board and all the servos are connected to the correct sockets on the circuit board in the proper orientation.

{% embed url="<https://youtu.be/A2RM1tplOtM>" %}
Bittle X with BiBoard V1 assembly and wiring tutorial
{% endembed %}


# 5 ⌨️ Board Configuration

"Who loves fried chips?" 🍟

There are two methods to configure NyBoard and BiBoard:

* The simplest method is to use the [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/introduction). No programming is involved. You can play with some preset modes.&#x20;
* &#x20;If you have some programming experience, you can use the [**Arduino IDE**](https://docs.petoi.com/arduino-ide/upload-sketch-for-nyboard). You will be able to modify the open-source codes for your new projects.&#x20;

If you are using BiBoard, please refer to [**this Arduino configuration instruction**](https://docs.petoi.com/arduino-ide/upload-sketch-for-biboard).


# 6 📐 Calibration

"A miss is as good as a mile." 🎯

## Preparations

1. all the servos are connected to the correct sockets on the board in the correct orientation
2. don't attach the legs to the servos.
   1. The reason is when the robot is powered, the legs could move into each other or collide with the body. The servos may be damaged after getting stuck for a long time.
3. long-press the battery power button
4. the blue and yellow LEDs on the board indicate the board is powered on

## Enter the calibration mode

{% hint style="info" %}
You must install the head and leg components on the servo's output shaft gear during calibration. No screws are required, but you must enter the calibration mode before installation.

There are five methods to enter the calibration state:

* Long-press the battery and boot up the robot with one side up. It will enter the calibration state automatically.   This feature is available for all robots manufactured after 2022.

![](/files/lDPxGArcsQ7GpoKdqLhH)

* Use the mobile app [**Petoi**](https://docs.petoi.com/mobile-app/app-guide#calibrate-the-joints) to enter the calibration panel.&#x20;
* Use [**Joint Calibrator**](https://docs.petoi.com/desktop-app/calibrator) in **Petoi Desktop App** :
  * If you have already connected the robot and computer with a serial port, It will enter the calibration state automatically when you click the " **Joint Calibrator**" button
  * Click the "**Calibrate**" button in the calibrator interface
* In the [**serial monitor**](https://docs.petoi.com/arduino-ide/calibration-with-arduino-ide) of Arduino IDE, enter the serial command "**c**"
* Press the calibrating button ![](/files/6DYC8s6tdYsm3Zo9wbBQ) (3,3 - the 3rd row and 3rd column) on the infrared remote.
  {% endhint %}

## Install the head

In the calibrated neutral state, place the head as close to the central axis as possible and insert its servo shaft into the servo arm of the neck.

![](/files/BqSXpgkht6ixLWijeWTm)

Press down on the head so it is firmly attached to the neck.

![](/files/Jij5SyU9BiSlDoHYzGuf)

## Install the legs&#x20;

Insert the upper legs and the lower legs into the output teeth of the servos while Bittle is powered on and in the neutral position. When inserting, try to keep the torso, upper leg, and lower leg at right angles with each other as much as possible. Pay attention not to install the lower leg backward (the correct orientation is shown in the picture below).&#x20;

![](/files/NVukKY66yYdaVlFtGoBQ)

## Calibrate the head and the legs&#x20;

To calibrate the head, adjust the neck servo angle in the app until the head is straight forward. If the servo angle reaches the limit but the head is still not straight, you should return the servo to the neutral position, and reattach the head closer to the forward position.

To calibrate the legs, place the L-shaped ruler included in the kit next to a leg, as shown in the picture below. (Note: the picture below shows the screws in the joints. You may put on the screws, but you should NOT tighten them before the calibration is finished.)

&#x20;Adjust the servo angles of the corresponding servo in the app until the reference features on the leg (i.e., the screw holes on the joints, the "muscle line" on the upper leg, and the triangular hollow space on the lower leg) are all aligned with the openings on the L-shaped ruler. Repeat this process for all four legs.

![](/files/ZirDfw8T1IalMHZOISOf)

Once calibration is finished, use the provided flat-head screws to secure all the shoulder and elbow joints.&#x20;

For more details, you can also read the calibration guides below:

* [**Petoi**](https://docs.petoi.com/app-guide) mobile app.&#x20;
* [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/calibrator).&#x20;
* Petoi [**Arduino IDE**](https://docs.petoi.com/arduino-ide/calibration-with-arduino-ide).&#x20;

For more details, please refer to the [Joint Calibration](https://docs.petoi.com/joint-calibration) in the Doc Center.


# 7 🔧  Final Assembly

One step away from the final victory. ⚙️

If the output shaft of your servo has a metal gear, use the M2x4 flathead screw to lock the legs/head.&#x20;

If the output shaft of your servo has a plastic gear, use the M2x6 self-tapping screw (same as the one to lock the servos) to lock the legs/head.

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

## 7.1 Head

To lock in the head, use a screw to lock the servo shaft and the servo arm from the bottom side of the chassis.

![](/files/dPQjuniT0mQdF4oKSzeI)

{% hint style="info" %}
In the latest kit, we enhanced the neck connection to include a hook. To reinforce the neck connection of the previous model, you can 3D print one of the [Bittle neck locks](https://github.com/PetoiCamp/NonCodeFiles/tree/master/stl/Bittle%20%26%20BittleX/BittleNeckLock).

<img src="/files/Lu2u9HPLkfU7QsRiANMK" alt="" data-size="original"> ![](/files/0kxYZiN7bkIe2NBtnzk8)

{% endhint %}

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

## 7.2 Limbs(upper and lower legs)

Use the screws to lock all the limbs.&#x20;

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

## 7.3 Wire shield

There’re two snaps on both sides of the wire shield. Their relative height is different.&#x20;

Flatten the wire of the lower leg to remove any coils. Then snap the wire shield to the upper leg.&#x20;

![](/files/qSGGRWTtaZ9oJruvzrnK)

The shield's edge should be parallel to the surface of the upper leg.&#x20;

You may need to recalibrate if more or less weight is put on Bittle or the center of mass has been changed.

![](/files/9fZeQ65GivL0M4kUObbz)

The picture below shows the wrong installation configuration.&#x20;

![](/files/GoEa5lbgHWNHT5zUnZWr)

## 7.4 Body cover and tail

The 6-pin female socket is used for connecting the programmer and communication dongles. Carefully bend it forward in a smooth arc if you are not going to attach a Raspberry Pi.&#x20;

![](/files/IEzwhV0ORTZmMV67tyMz)

Attach the tail to the pin on the cover.

![](/files/OjPDP7umPxt2y0yW8n4o)

Snap the cover from one side of the body. Organize the wires so that they don't get stuck between the cover and the body. Then push the cover down to the other side of the body. You should hear a clear snap sound.&#x20;

![](/files/LgkWUWovVWg7gWsfvlTC)


# 8 🕹 Play with Bittle

"You can't direct the wind, but you can adjust your sails." ⛵️

### See [the Getting Started guide](https://docs.petoi.com/getting-started-guide).

There are 4 methods for users without any programming experience to control Bittle:

* Use [**the IR Remote Controller**](https://docs.petoi.com/ir-remote/remote-controller).
* Use [**Petoi Mobile App**](https://docs.petoi.com/mobile-app/controller).
* Use [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/skill-composer).
* Use [**Petoi Coding Blocks**](https://docs.petoi.com/graphical-programming-interface/petoi-coding-blocks).

If you have some programming experience or want to explore more advanced features, you can try the following methods:

* Use [**Arduino IDE**](https://docs.petoi.com/arduino-ide/serial-commands).
* Use [**Python**](https://docs.petoi.com/python/serialmaster-user-guide).
* Use [**MicroPython**](https://docs.petoi.com/communication-modules/wifi-esp8266/micropython-controller).
* Use [**ESP8266 + Python**](https://docs.petoi.com/communication-modules/wifi-esp8266/esp8266-+-python-scripts-implement-wireless-crowd-control).
* Use [**Raspberry Pi**](https://docs.petoi.com/api/raspberry-pi-serial-port-as-an-interface).
* Use ~~the~~ [**extensible modules**](https://docs.petoi.com/extensible-modules/introduction).


# 9 👨‍🏫 Teach Bittle New Skills

There are two ways to create new skills for Bittle:

* Use [the Skill Composer](https://docs.petoi.com/desktop-app/skill-composer) in the desktop app
* [Write Arduino code](https://docs.petoi.com/applications/skill-creation)

If you are a robotics professional, this user-generated [URDF structure](broken://spaces/ntUipGYjnJE9HQWSovJT/pages/6ZL2tmR5Hvqy4CD0bYFJ) may be useful to set up a scientific simulation.&#x20;


# 10 👨‍🎓 Understand OpenCat.h

"Let the cat out of the bag." 🧞‍♂️

## 🔬It will make another textbook.&#x20;

The controlling framework behind Bittle is OpenCat, which I've been developing for a while. You can read more stories from my [posts](https://www.hackster.io/petoi/opencat-845129) on Hackster.io.

![](/files/-MShc6IRKyzRVWzYnJZ8)

It's too much work for now 🤷🏻‍♂️ but you are welcome to discuss it with me on the forum or through email. For example, there are [code reviews](https://www.petoi.com/forum/software/flavien-opencat-code-reviews) on the forum. I will keep the code compatible with future OpenCat models, and even [your own DIY robots](https://www.petoi.com/forum/showcase)! Hopefully, the documentation will be completed during the process.&#x20;


# 11 🔩 Extensible Modules

## Please refer to the [Extensive Modules](https://docs.petoi.com/extensive-modules/introduction) in the Doc center.


# คู่มือการใช้งาน Petoi Bittle  🐶

Rongzhong Li

{% hint style="success" %}
คุณสามารถดูเนื้อหาเพิ่มเติมบางอย่างได้ที่ : <https://www.yuque.com/tinkergen-help-en/bittle>
{% endhint %}

## เริ่มต้นใช้งาน

เพื่อให้คำแนะนำเหล่านี้ง่ายต่อการใช้งานและความเข้าใจ บทความนี้จึงมุ่งเน้นไปที่การประกอบมากกว่าคำอธิบายเชิงลึก

![](/files/-M_LOvll0vPoNS7OhIqm)

หากคุณมีคำถามที่เฉพาะเจาะจงเกี่ยวกับ "ทำไม" มากกว่า "อย่างไร" โปรดโพสต์บนฟอรัมของเราที่ <https://www.petoi.com/forum> หรือส่งอีเมลไปที่ <support@petoi.com>.

คุณสามารถสนับสนุนเราได้ด้วยการซื้อสินค้าที่ [www.petoi.com/store](https://bittle.petoi.com/thai-2/www.petoi.com/store). บัญชีโซเชียลมีเดียของเรา (Instagram/Twitter/Facebook/GitHub) คือ **@PetoiCamp**. แบ่งปันงานสร้างของคุณโดยติดแท็ก **#bittle #petoi #opencat** เพื่อให้เราสามารถรีโพสถึงคุณได้

{% hint style="info" %}
Last Updated: 15/03/2023
{% endhint %}


# 1 🧘‍♂️ เครื่องมือและการเตรียมการ

"A beard well lathered is half shaved." 🪒

## 1.1การเตรียมการ

เมื่อได้รับสินค้าแล้วถึงขั้นตอนการเปิดกล่องเช็คของดูโปรดถ่ายคลิปก่อนการเปิดแกะสินค้าเพื่อเป็นหลักฐานยืนยันหากอุปกรณ์ใดสูญหายไป

{% hint style="success" %}
การทำงานในห้องที่ไม่มีพรมหรือกระเบื้องโมเสกจะดีกว่า สกรูและสปริงขนาดเล็กสามารถหายไปได้อย่างหากหล่นลงบนพื้น
{% endhint %}

## 1.2 เครื่องมือและอุปกรณ์เสริม

{% tabs %}
{% tab title="Required" %}

| เครื่องมือ                    | **หมายเหตุ**                                                                                                                                                                         |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ไขควงปากแบนและแฉก             | สำหรับสกรู M2 (เส้นผ่านศูนย์กลาง = 2 มม.)                                                                                                                                            |
| คอมพิวเตอร์ Windows/Mac/Linux | <p>ดาวน์โหลด <a href="https://github.com/PetoiCamp/OpenCat/releases">Petoi Desktop APP</a></p><p>ติดตั้งล่าสุด <a href="https://www.arduino.cc/en/Main/Software">Arduino IDE</a></p> |
| พอร์ตชาร์จ USB                | เอาต์พุต 5V 1A ควรจะเพียงพอ                                                                                                                                                          |
| {% endtab %}                  |                                                                                                                                                                                      |

{% tab title="Optional" %}

| **เครื่องมือ**                       | **หมายเหตุ**                                                |
| ------------------------------------ | ----------------------------------------------------------- |
| หัวแร้งพร้อมอุปกรณ์สำหรับการบัดกรี   | สำหรับการแก้ไข PCB หากคุณเป็นแฮ็กเกอร์!                     |
| เครื่องพิมพ์สามมิติพร้อมอุปกรณ์เสริม | เพิ่มการออกแบบพิเศษของคุณ                                   |
| ชุด Arduino/Raspberry Pi             | เพิ่มแกดเจ็ตเพิ่มเติมใน Bittle                              |
| มัลติมิเตอร์                         | ทดสอบและดีบัก                                               |
| ออสซิลโลสโคป                         | ทดสอบและดีบัก                                               |
| กาวร้อน/กาวซุปเปอร์                  | หลีกเลี่ยงการใช้พวกเขา Bittle ได้รับการออกแบบให้ปราศจากกาว! |
| {% endtab %}                         |                                                             |
| {% endtabs %}                        |                                                             |


# 2 🧩 เปิดกล่อง

"life is like a box of Bittle." 🔍

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

## 2.1 Bittle ที่ประกอบสำเร็จรูป

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

หากคุณได้รับ Bittle ที่ประกอบสำเร็จรูปขั้นตอนแรกจะต้องติดตั้งหัวเข้ากับตัวบอดี้และ**ทำการปรับองศาของเข่าให้เป็นธรรมชาติ**ดังภาพด้านล่างการเดินสายจะต้องลากจากเข่าด้านหน้าไปยังไหล่เพื่อหลีกเลี่ยงการบีบเมื่อข้อต่อหัวเข่าหมุน ติดตั้งให้ได้ดังท่าต่อไปนี้ก่อนเปิดเครื่อง

![Pay attention to the direction of the head and the joints](/files/qYU67jntWswERCxR3gY3)

**กดปุ่ม**แบตเตอรี่ค้างไว้ 2\~3 วินาทีเพื่อเปิด/ปิดเครื่อง **ถอดแผ่นฉนวนของแบตเตอรี่รีโมทอินฟราเรดออก** จากนั้นคุณสามารถ [control Bittle to move](https://docs.petoi.com/infrared-remote/remote-controller) หุ่นยนต์จะหยุดการเคลื่อนไหวอย่างต่อเนื่องด้วยเสียงบี๊บเมื่อแบตเตอรี่เหลือน้อย จากนั้นคุณต้องชาร์จแบตเตอรี่ด้วยสายไมโคร USB 5V คำนึงถึงความปลอดภัย แบตเตอรี่จะไม่จ่ายไฟระหว่างการชาร์จ&#x20;

![](/files/-MSmyAEyBm8iJJ42uyMK)

{% hint style="warning" %}
หากขาท่อนล่างของ Bittle อยู่ในทิศทางที่ถูกต้องแต่ไม่ขยับเมื่อทำการคาลิเบลท คุณอาจหมุนขาไปในทิศทางที่ถูกต้อง คุณควรรู้สึกถึงแรงต้านปานกลางจนกระทั่งล็อคข้อต่อในตำแหน่งที่ถูกต้อง สาเหตุคือเฟืองใหม่แน่นเกินไปเล็กน้อยและแรงต้านการบู๊ตสูงจะทำให้อัลกอริธึมการป้องกันทำงาน เซอร์โวจะลดแรงที่ข้อต่อเพื่อหลีกเลี่ยงกระแสไฟเกิน ซึ่งจะทำให้ข้อต่อหยุดเคลื่อนไหว
{% endhint %}

**ความหมายของเสียง Buzzer  :**

<table><thead><tr><th width="199.10714285714286">ประเภทเสียง</th><th>ช่วงที่เกิด</th><th>คำอธิบาย</th></tr></thead><tbody><tr><td>ทำนองสั้น</td><td>เปิดเครื่องหรือรีบูต</td><td>โปรแกรมเริ่มทำงานสำเร็จ</td></tr><tr><td>เสียงบี๊บสั้น</td><td>ระหว่างการใช้งาน</td><td>โปรแกรมได้รับคำสั่ง</td></tr><tr><td>ทำนองซ้ำ</td><td>ระหว่างการใช้งานและการหยุดการเคลื่อนไหว</td><td>แบตเตอรี่อ่อนหรือไม่ได้เชื่อมต่อ</td></tr></tbody></table>

คุณสามารถข้ามบทที่ 3 การกำหนดค่  **NyBoard Configuration**,  บทที่ 4  **Assemble the Frame** และบทที่ 5 **Connect Wires** ไปที่บทที่ 6  [**Calibration**](https://bittle.petoi.com/6-calibration) คุณอาจต้องเปิดฝาหลังของ Bittle เพื่อเสียบดองเกิลบลูทูธ

{% hint style="warning" %}
Bittle ที่ประกอบสำเร็จรูปได้รับการจูนแบบคร่าวๆเท่านั้น ผู้ใช้งานจำเป็นต้องคาลิเบรทข้อต่อของ Bittle  และการประกอบขั้นสุดท้ายเพื่อปรับแต่งข้อต่อเพื่อให้ได้ประสิทธิภาพที่ดีที่สุด
{% endhint %}

{% hint style="warning" %}
แรงเสียดทานมีบทบาทสำคัญในการทรงตัวแบบไดนามิกระหว่างการเดิน แม้ว่าซิลิโคนหุ้มปลายเท้า (ถุงเท้า) จะช่วยปรับปรุงการยึดเกาะได้ แต่ก็ช่วยเพิ่มความแตกต่างของพื้นผิวที่คาดเดาไม่ได้ในสภาพแวดล้อมการทดสอบของคุณ ดังนั้นสำหรับการใช้งานเป็นประจำ เราแนะนำให้วิ่ง Bittle โดยไม่ใส่ถุงเท้า เว้นแต่คุณจะปรับการเดินได้หรือต้องการแรงเสียดทานเพื่อทำงานบางอย่าง
{% endhint %}

## 2.2 ชุด Bittle ที่ไม่ได้ประกอบสำเร็จรูป

หากคุณสั่งซื้อชุด Bittle ที่ไม่ได้ประกอบ คุณจะต้องไขปริศนาที่ท้าทายและสนุกสนาน คุณจะได้เรียนรู้เพิ่มเติมเกี่ยวกับหุ่นยนต์หลังจากเข้าใจตรรกะการออกแบบเบื้องหลัง Bittle โปรดย้ายไปที่บทต่อไปนี้เพื่อดูรายละเอียด


# 3 ⌨️ การกำหนดค่าบอร์ด

"Who loves fried chips?" 🍟

มีสองวิธีในการกำหนดค่า NyBoard:

* วิธีที่ง่ายที่สุดคือการใช้ [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/introduction) ไม่มีการเขียนโปรแกรมใด ๆ ที่เกี่ยวข้อง คุณสามารถเล่นกับโหมดที่ตั้งไว้ล่วงหน้าบางโหมดได้
* &#x20;หากคุณมีประสบการณ์ในการเขียนโปรแกรมมาบ้าง คุณสามารถใช้ [**Arduino IDE**](https://docs.petoi.com/arduino-ide/upload-sketch-for-nyboard). คุณจะสามารถแก้ไขรหัสโอเพ่นซอร์สสำหรับโครงการใหม่ของคุณได้

หากคุณใช้ BiBoard โปรดดูที่นี่ [**Arduino configuration instruction**](https://docs.petoi.com/arduino-ide/upload-sketch-for-biboard).


# 4 🏗 การประกอบจากชุดอุปกรณ์

"The whole is more than the sum of its parts." 🔩

## 4.1 เริ่มประกอบสำหรับชุดที่ไม่ได้ประกอบ

คุณสามารถดูแอนิเมชั่นการประกอบสำหรับ Bittle ได้อย่างรวดเร็ว

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

ต่อไปนี้เป็นบทช่วยสอนโดยละเอียดเพิ่มเติมเกี่ยวกับการสร้าง Bittle จากชุดอุปกรณ์

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

## 4.2 คำแนะนำทีละขั้นตอน (อยู่ระหว่างการปรับปรุง)

คุณสามารถทำส่วนต่อไปนี้ให้เสร็จ แล้วนำมารวมกันในบทต่อๆ ไป

* คอ
* บอดี้หรือลำตัว&#x20;
* ขาท่อนบน
* ขาท่อนล่าง
* หัว
* เซอร์โวไหล่
* แบตเตอรี่

### 4.2.1 คอ

วัสดุ：

* คอ x 1
* แขนเซอร์โว x 1
* M2x8 สกรูเกลียวปล่อยปลายแหลมx 2

![](/files/-MTM-WiLiUQ4UqWFshk8)

ใส่แขนเซอร์โวในส่วนคอเหมือนรูปด้านล่าง ฟันของแขนเซอร์โวควรหงายขึ้น

![](/files/-MTM-WiMQVG5EHLlMm6T)![](/files/-MTM-WiNrekkfKsoEKhm)

ขันสกรูเกลียวปล่อย M2x8 สองตัวที่ด้านข้างทั้งสองด้านของแขนเซอร์โว อย่าขันสกรูแน่นเกินไป

![](/files/-MTM-WiO9OR_VuXkRcNk)![](/files/-MTM-WiPv0UGMcRj7wRs)

เสร็จสิ้น:

![](/files/-MTM-WiQF3VPFvoxHVCi)

### 4.2.2 ลำตัว&#x20;

{% hint style="info" %}
ตอนนี้ชิ้นส่วนนี้ได้รับการประกอบอย่างสมบูรณ์ในแพ็คเกจของเราแล้ว
{% endhint %}

วัสดุ:

* คอที่ประกอบแล้ว x 1
* โครง x 1
* เพลตด้านหน้าและหลัง x 2
* ไหล่ด้านข้าง x 2

![](/files/-MTM-WiRJDfVd1N1ikmc)

ระมัดระวังด้านหน้าและด้านหลังโครง ตำแหน่งของรูขนาดใหญ่ 2 รูตามร่องกลางสร้างความแตกต่าง ในการกำหนดค่ามาตรฐาน เรากำหนดรูที่จะเลื่อนไปทางหาง คุณยังสามารถพบเครื่องหมาย "A1" ขนาดเล็กที่ด้านหน้าของแชสซี

![](/files/-MTM-WiSqQE_8K3MCTXL)![](/files/-MTM-WiTX24179iptTH6)

ดันส่วนปลายด้านหลังของคอที่ประกอบเข้าไปในช่องของโครงซี จากนั้นกดขอเกี่ยวด้านหน้าลงจนได้ยินเสียงสแน็ป

![](/files/-MTM-WiUgMBmPHYf55aG)![](/files/-MTM-WiVYNOQNQIpZ2oR)

{% hint style="info" %}
ฉันออกแบบคอเป็นโซ่ที่มีความยืดหยุ่นเพื่อปลดระหว่างการชน มิฉะนั้น แรงกระแทกจะถูกส่งต่อไปยังเซอร์โวหรือโครงตัวเครื่องและทำให้เกิดความเสียหายที่ไม่สามารถซ่อมแซมได้
{% endhint %}

ใส่ยึดโครงลงในไหล่ด้านใดด้านหนึ่ง

![](/files/-MTM-WiWzXigZeeiYPid)![](/files/-MTM-WiXtzI_k4VojJz1)

ใส่แผ่นด้านหน้าหรือด้านหลังลงในไหล่ด้านข้าง มีสามเดือยในแต่ละด้านของจาน ใส่เดือยด้านหน้าสองตัวเป็นกลุ่มเดียวเพื่อให้จัดตำแหน่งได้ดีขึ้น

![](/files/-MTM-WiYOcJPiD0fl7eD)![](/files/-MTM-WiZiJODbAkOt8Fv)

ใส่เพลททั้งหน้าและหลัง

![](/files/-MTM-Wi_e-huKvoeamsf)

เสียบไหล่อีกข้างเพื่อให้ร่างกายสมบูรณ์ ให้ความสนใจอีกครั้งกับการจัดตำแหน่งเดือยของแผ่นด้านหน้าและด้านหลัง

![](/files/-MTM-Wia4vf4B2MOaQSR)

เสร็จสิ้น:

![](/files/-MTM-Wibow6VZCJANyUj)

### 4.2.3 ขาท่อนบน&#x20;

มันค่อนข้างยากที่จะอธิบายด้วยคำพูด โปรดดูที่การประกอบ [instruction video at 3:23](https://youtu.be/oJ2Y9hZgCEY?t=203). ต้องใช้ทักษะมากกว่ากำลัง มี [forum post](https://www.petoi.com/forum/basic-assembly-and-setup/just-got-my-bittle-kit-can-t-install-springs) ปรึกษาเรื่องการติดตั้งสปริงด้วยเครื่องมือต่างๆ&#x20;

![](/files/-McnHWs6mshPrzo8frXi)

### 4.2.4 ขาท่อนล่าง

วัสดุ:

* P1S เซอร์โวสายแบบยาว x 4
* ขาท่อนล่าง x4
* M2x8 สกรูเกลียวปล่อย x 8

![](/files/-MTM-WicMvS9YEFhmVW2)

ประกอบขาขวา ใส่เซอร์โวลงในหน้าต่าง ดูวิดีโอแนะนำเพื่อดูทิศทางที่ถูกต้องในการพับลวด รอยบากที่ขอบด้านในออกแบบมาเพื่อให้ลวดทะลุได้ ใช้สกรู M2x8 สองตัวเพื่อยึดเซอร์โวเข้ากับขาด้านล่าง

![](/files/-MTM-WidAJU_AlLwaged)![](/files/-MTM-Wie_uiWMeASHUgs)![](/files/-MTM-Wifgyr_q_pILMpb)

ขาซ้ายอยู่ตรงข้ามกับขาขวา อย่างไรก็ตามขาหน้าและขาหลังเหมือนกัน ดังนั้นคุณควรสร้างขาสองคู่ที่มีรูปแบบตรงกันข้าม

![](/files/-MTM-WigHuB0M6J5iSJU)

### 4.2.5 หัว

วัสดุ:

* P1S เซอร์สายแบบสั้น x 1
* คาง x 1
* กระโหลก x 1
* M2x8 สกรูเกลียวปล่อย x 2

วางเซอร์โวไว้ที่คางดังแสดงในรูป ให้ความสนใจกับทิศทางของสายของเซอร์โว หลังจากนั้น ให้ติดตั้งสกรูเกลียวปล่อย M2x8 สองตัว

![](/files/-MTM-Wihvko0B8KyoqzV)

ใส่กะโหลกเข้าไปในคางเพื่อให้สามารถหมุนและกัดอุปกรณ์ขนาดเล็กได้ ฉันแนะนำให้คุณทาสารหล่อลื่นที่จุดสัมผัสระหว่างกะโหลกกับคาง

![](/files/-MTM-WiigCEWbC8D08bm)

### 4.2.6 เซอร์โวส่วนไหล่

วัสดุ:

* P1S เซอร์โวแบบสายสั้น x 4
* M2x8 สกรูเกลียวปล่อย x 8
* หัว (ประกอบแล้ว)
* ลำตัว (ประกอบแล้ว)
* ขาท่อนล่าง (ประกอบแล้ว) x 4

ใส่ส่วนหัว ลำตัว เซอร์โว และขาท่อนล่างเหมือนรูปด้านล่าง สอดสายเซอร์โวสั้นๆ ผ่านช่องเสียบเซอร์โวที่ไหล่ด้านข้าง ให้ความสนใจกับทิศทางของเซอร์โวอย่างระมัดระวังและวางในการกำหนดค่าที่ถูกต้อง

มุมมองด้านข้าง:

![](/files/-MTM-WijmZALXT6d5LPm)

มุมมองด้านบน:

![](/files/-MTM-WikA3OwjmDF-WiK)

คุณต้องใส่สายของเซอร์โวหัวเข้าไปในร่างกายด้วย

ใส่เซอร์โวสายสั้นเข้าที่ไหล่ด้านข้างหลังจากยืนยันทิศทางของส่วนประกอบทั้งหมดแล้ว ให้ความสนใจกับทิศทางของเพลาขาออกของเซอร์โวไหล่ ควรสอดสายยาวของเซอร์โวขาส่วนล่างเข้าไปในช่องระหว่างเซอร์โวไหล่และหน้าต่างไหล่ ใช้สกรูเกลียวปล่อย M2x8 สองตัวเพื่อยึดเซอร์โวแต่ละตัว

![](/files/-MTM-Wil8VtTgzvbFdNI)

### 4.2.7 แบตเตอรี่

เสียบปลั๊กแบตเตอรี่เข้ากับปลั๊กไฟใต้ตัวเครื่อง:

![](/files/-MSGx1rtLeUmpYBaER4X)

วางแบตเตอรี่ในทิศทางที่แสดงในรูปด้านล่าง โดยจัดตำแหน่งให้ตรงกับรูยึด:

![](/files/-MSGx1rzdoXzntKmLhd2)

ใส่แบตเตอรี่:

![](/files/-MSGx1s-WJF5fzdpptR1)

ขณะที่กดแบตเตอรี่ค้างไว้ ให้ดันแบตเตอรี่ไปทางศีรษะ และจัดสายไฟหลังจากที่แบตเตอรี่เข้าที่ ดังแสดงในรูปต่อไปนี้:

![](/files/-MSGx1s0ooClXKrR9g1Q)

กดปุ่มบนแบตเตอรี่ค้างไว้นานกว่า 3 วินาที หากไฟสีแดงบนแบตเตอรี่ติดสว่าง โปรดชาร์จจนไฟสีเขียวบนแบตเตอรี่ติดสว่างก่อนใช้งาน แหล่งจ่ายไฟเริ่มจ่ายไฟ และไฟ LED สีเหลืองและสีน้ำเงินบน NyBoard จะสว่างขึ้นพร้อมกัน

![](/files/-MSGx1rudzULpj0l2yWt)


# 5 🔌 การเชื่อมต่อสายไฟ

"Everything is connected." 🤝

## 5.1 เดินสายเซอร์โว

### NyBoard

เชื่อมต่อสายไฟของเซอร์โวเข้ากับพินเซอร์โวของ NyBoard ตามด้านล่าง เป็นไปตามสมมาตรแบบวงกลม สังเกตดัชนีข้ามระหว่างเซอร์โวหัวและขา (1\~7) สงวนไว้สำหรับหุ่นยนต์ในอนาคตของเราที่มีข้อต่อมากขึ้น

![](/files/ORpPOCgWdUJFDYXNymQh)

<figure><img src="/files/ndwgzaoPsHyVwzh0XtCh" alt=""><figcaption><p>Observe the wiring pattern on the board</p></figcaption></figure>

{% hint style="danger" %}
หมายเลขดัชนีของเซอร์โวร่วมไม่มีความสัมพันธ์ที่สอดคล้องกับหมายเลขพิน PWM บนเมนบอร์ด คุณไม่จำเป็นต้องอ่านหมายเลขพินบนบอร์ด PCB
{% endhint %}

สายสีดำ (สาย GND) ควรอยู่ใกล้กับบอร์ด

![](/files/-MTM-WimcJAGGrjcnrOw)

มุมมองด้านล่าง:

![](/files/-MTM-Win_KDbqjJgjyNA)

สอดตัวรับสัญญาณอินฟราเรดไว้ใต้แผ่นหลังเพื่อให้เซ็นเซอร์เปิดรับแสงออกสู่ภายนอก

![](/files/-MTM-Wio4N0I-BzZoewa)

![](/files/-MTM-WipuCZN-A2JuJb8)

ตรวจสอบให้แน่ใจว่าสายไฟเข้าไปในตัวเครื่อง ข้ามคอลัมน์ จากนั้นเสียบเข้ากับหมุดเซอร์โว จัดเรียงสายไฟไม่ให้เข้าไปขวางระหว่างปลั๊กเซอร์โวและโครงตัวเครื่อง NyBoard ควรอยู่ในระดับสี่ความขัดแย้ง ใช้สกรูเกลียวปล่อย M2x8 สี่ตัวเพื่อยึด NyBoard

![](/files/-MTM-Wiq2hlW3IXgI7rm)

เสร็จสมบูรณ์:

![](/files/-MTM-WirguxJis5un9Fx)

![](/files/-MTM-Wisp_7IuDcaDNJk)

### BiBoard

แม้ว่า BiBoard จะมีพินเพียง 12 พิน แต่หมายเลขดัชนีร่วมจะถูกกำหนดค่าตามลำดับเดียวกับ NyBoard การเชื่อมต่อระหว่างเซอร์โวร่วมและพินแสดงในรูปด้านล่าง:

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

## 5.2 เตรียมการสำหรับการคาลิเบรท

{% hint style="info" %}
เมื่อทำการคาลิเบรท คุณต้องติดตั้งส่วนประกอบส่วนหัวและส่วนขาบนเฟืองของเพลาขาออกของเซอร์โว ไม่จำเป็นต้องใช้สกรู แต่คุณต้องเข้าสู่โหมดการคาลิเบรทก่อนการติดตั้ง มีห้าวิธีในการเข้าสู่สถานะการคาลิเบรท:

* กดแบตเตอรี่ค้างไว้แล้วบู๊ตหุ่นยนต์โดยหันด้านหนึ่งขึ้น มันจะเข้าสู่สถานะการคาลิเบรทโดยอัตโนมัติ ภาพด้านล่างแสดงขาบนและขาล่างที่ติดตั้งหลังจากหุ่นยนต์เข้าสู่สถานะการคาลิเบรท

![](/files/c5tYduIcmQzVP8XBh6bt)

* ใช้แอพมือถือ [**Petoi**](https://docs.petoi.com/mobile-app/app-guide#calibrate-the-joints) เพื่อเข้าสู่หน้าการคาลิเบรท
* ใช้ [**Joint Calibrator**](https://docs.petoi.com/desktop-app/calibrator) ใน **Petoi Desktop App** :
  * หากคุณเชื่อมต่อหุ่นยนต์และคอมพิวเตอร์ด้วยซีเรียลพอร์ตแล้ว หุ่นยนต์จะเข้าสู่สถานะการคาลิเบรทโดยอัตโนมัติเมื่อคุณคลิกปุ่ม "**Joint Calibrator**"
  * คลิกปุ่ม "**Calibrate**" เพื่อเข้าสู่หน้าคาลิเบรท
* ใน [**serial monitor**](https://docs.petoi.com/arduino-ide/calibration-with-arduino-ide) ของ Arduino IDE สามารถพิมพ์  "**c**"
* กดปุ่มคาลิเบรท ![](/files/6DYC8s6tdYsm3Zo9wbBQ)(3,3 - แถวที่ 3 และคอลัมน์ที่ 3) บนรีโมทอินฟราเรดInstall the head
  {% endhint %}

ในสถานะที่เป็นกลางที่คาลิเบรทแล้ว ให้วางหัวให้ใกล้กับแกนกลางมากที่สุดเท่าที่จะเป็นไปได้ และสอดเพลาเซอร์โวเข้าไปในแขนเซอร์โวของคอ

![](/files/BqSXpgkht6ixLWijeWTm)

กดศีรษะลงเพื่อให้แนบกับคออย่างแน่นหนา

![](/files/Jij5SyU9BiSlDoHYzGuf)

### ติดตั้งขา&#x20;

ติดตั้งชิ้นส่วนขาบนและขาล่างเข้ากับฟันขาออกของเซอร์โวเมื่อเปิด Bittle และอยู่ในตำแหน่งที่เป็นกลางที่ปรับเทียบแล้ว โปรดให้ลำตัว ขาท่อนบน และขาท่อนล่างติดตั้งในแนวตั้งให้มากที่สุดเท่าที่จะเป็นไปได้ และอย่าติดตั้งท่อนล่างไปข้างหลังดังที่แสดงในภาพ

![](/files/NVukKY66yYdaVlFtGoBQ)

การวัดและการติดตั้งสามารถทำได้โดยใช้ไม้บรรทัดสามเหลี่ยมหรือไม้บรรทัดรูปตัว L ที่รวมอยู่ในชุด

![](/files/ZirDfw8T1IalMHZOISOf)


# 6 📐 การคาลิเบรท

"A miss is as good as a mile." 🎯

{% hint style="danger" %}
คุณไม่ควรต่อขาเข้ากับเซอร์โวก่อนการคาลิเบรทครั้งแรก

เมื่อปิดเซอร์โว เพลาขาออกสามารถหมุนเป็นมุมสุ่มได้ หากคุณแนบขา หุ่นยนต์จะไม่รู้ว่าขาชี้ไปทางไหน เมื่อหุ่นยนต์ได้รับพลังงาน ขาอาจวิ่งเข้าหากันหรือชนกับร่างกายได้ เซอร์โวอาจเสียหายหลังจากติดขัดเป็นเวลานาน
{% endhint %}

ข้อต่อของหุ่นยนต์ต้องได้รับการปรับเทียบก่อนใช้งานในอนาคต ตรวจสอบให้แน่ใจว่าเซอร์โวทั้งหมดเชื่อมต่อกับจุดที่ถูกต้องบนแผงวงจรในทิศทางที่ถูกต้อง แบตเตอรี่กำลังจ่ายไฟอยู่ (ไฟ LED สีเหลืองในโลโก้แมวติดสว่าง) และขาและหัวทั้งหมดไม่ได้ติดอยู่กับเซอร์โว ดังนั้น ที่เซอร์โวสามารถหมุนได้อย่างอิสระ

ขั้นตอนการคาลิเบรทของเราจะส่งสัญญาณการคาลิเบรทไปยังกระดานหลักและหมุนข้อต่อทั้งหมดไปยังตำแหน่งที่ทราบ จากนั้นคุณสามารถแนบขาใกล้กับท่าทางอ้างอิง และปรับมุมอย่างละเอียดโดยใช้ซอฟต์แวร์

มีสามวิธีในการคาลิเบรท Bittle:

* ใช้แอพมือถือ [**Petoi**](https://docs.petoi.com/app-guide).&#x20;
* ใช้ [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/calibrator).
* ใช้ [**Arduino IDE**](https://docs.petoi.com/arduino-ide/calibration-with-arduino-ide).&#x20;


# 7 🔧  ขั้นตอนสุดท้ายของการประกอบ

One step away from the final victory. ⚙️

## 7.1 หัว

ในการล็อคหัว ให้ใช้สกรูหัวแบน M2x4 เพื่อล็อคเพลาเซอร์โวและแขนเซอร์โวจากด้านล่างของแชสซี

![](/files/dPQjuniT0mQdF4oKSzeI)

## 7.2 แขนขา (บนและล่าง)

ใช้สกรูหัวแบน M2x4 เพื่อล็อคแขนขาทั้งหมด

![](/files/Yp1fiXBs2dxSXOu9AdOG)

## 7.3 ฝาครอบสายไฟ

มีสองสแน็ปที่ทั้งสองด้านของแผงป้องกันสายไฟ ความสูงสัมพัทธ์ของพวกเขาแตกต่างกัน

ทำให้สายไฟของขาส่วนล่างเรียบเพื่อเอาสายไฟออก จากนั้นยึดตัวป้องกันสายไฟเข้ากับขาด้านบน

![](/files/qSGGRWTtaZ9oJruvzrnK)

ขอบของฝาครอบควรขนานกับพื้นผิวของขาท่อนบน

คุณอาจต้องคาลิเบรทใหม่หากใส่น้ำหนักมากหรือน้อยหรือจุดศูนย์กลางมวลเปลี่ยนไป

![](/files/9fZeQ65GivL0M4kUObbz)

ด้านล่างแสดงการกำหนดค่าการติดตั้งที่ไม่ถูกต้อง

![](/files/GoEa5lbgHWNHT5zUnZWr)

## 7.4 ฝาครอบลำตัวและหาง

ซ็อกเก็ตตัวเมีย 6 ขาใช้สำหรับเชื่อมต่อโปรแกรมเมอร์และดองเกิลการสื่อสาร โค้งงอไปข้างหน้าอย่างระมัดระวังในส่วนโค้งที่เรียบ หากคุณไม่ต้องการต่อ Raspberry Pi

![](/files/IEzwhV0ORTZmMV67tyMz)

ติดหางเข้ากับหมุดบนฝาครอบ

![](/files/OjPDP7umPxt2y0yW8n4o)

ปิดฝาครอบจากด้านใดด้านหนึ่งของร่างกาย จัดระเบียบสายไฟเพื่อไม่ให้ติดระหว่างฝาครอบและตัวเครื่อง จากนั้นดันฝาครอบลงไปอีกด้านของตัวเครื่อง คุณควรได้ยินเสียงสแน็ปที่ชัดเจน

![](/files/LgkWUWovVWg7gWsfvlTC)


# 8 🕹การเล่นกับ Bittle

"You can't direct the wind, but you can adjust your sails." ⛵️

มี 7 วิธีในการควบคุม Bittle:

* ใช้ [**IR Remote Controller**](https://docs.petoi.com/ir-remote/remote-controller).
* ใช้แอพมือถือ [**Petoi**](https://docs.petoi.com/app-guide).
* ใช้ [**Petoi Desktop App**](https://docs.petoi.com/desktop-app/skill-composer).
* ใช้ [**Arduino IDE**](https://docs.petoi.com/arduino-ide/serial-commands).
* ใช้ [**Python**](https://docs.petoi.com/python/serialmaster-user-guide).
* ใช้ [**ESP8266 + Python**](https://docs.petoi.com/communication-modules/wifi-esp8266/esp8266-+-python-scripts-implement-wireless-crowd-control).
* ใช้ [**MicroPython**](https://docs.petoi.com/communication-modules/wifi-esp8266/micropython-controller).


# 9 👨‍🏫 สอนทักษะใหม่ของ Bittle

มีสองวิธีในการสร้างทักษะใหม่สำหรับ Bittle:

* ใช้ [the Skill Composer](https://docs.petoi.com/desktop-app/skill-composer) บน desktop app
* [Write Arduino code](https://docs.petoi.com/applications/skill-creation)


# 10 👨‍🎓 ทำความเข้าใจกับ OpenCat.h

"Let the cat out of the bag." 🧞‍♂️

## 🔬กำลังจะมี textbook โดยเฉพาะ.&#x20;

กรอบการควบคุมที่อยู่เบื้องหลัง Bittle คือ OpenCat ซึ่งฉันได้พัฒนามาระยะหนึ่งแล้ว คุณสามารถอ่านเรื่องราวเพิ่มเติมจากโพสต์ของฉัน  [posts](https://www.hackster.io/petoi/opencat-845129) บน Hackster.io.

![](/files/-MShc6IRKyzRVWzYnJZ8)

ตอนนี้งานเยอะเกินไป 🤷🏻‍♂️ แต่คุณสามารถพูดคุยกับฉันในฟอรัมหรือทางอีเมล ตัวอย่างเช่นมี [code reviews](https://www.petoi.com/forum/software/flavien-opencat-code-reviews) บนฟอรัม ฉันจะรักษารหัสให้เข้ากันได้กับรุ่น OpenCat ในอนาคตและแม้กระทั่งสามารถสร้างหุ่นของตัวเองได้ ( [your own DIY robots](https://www.petoi.com/forum/showcase)!) หวังว่าเอกสารจะเสร็จสมบูรณ์ในระหว่างกระบวนการ


# 11 🔩 โมดูลขยายเพิ่มเติม

## โปรดดูที่  [Extensive Modules](https://docs.petoi.com/extensive-modules/introduction) ในศูนย์เอกสาร


