Petoi Doc Center
🇺🇸English
🇺🇸English
  • Welcome to Petoi Doc Center
  • Getting Started Guide
  • 🙋‍♂️FAQ(Frequently Asked Questions)
  • Petoi robot joint index
    • Joint Pins on NyBoard
      • Nybble
      • Bittle
    • Joint Pins on BiBoard V0
      • Bittle X
      • Bittle X+Arm
    • Joint Pins on BiBoard V1
      • Bittle X
      • Bittle X+Arm
      • Nybble Q
  • Bluetooth Connection
    • BiBoard
    • NyBoard
  • Upload Firmware
    • NyBoard
    • BiBoard V0
    • BiBoard V1
  • Joint Calibration
  • Infrared Remote
    • Remote Controller
  • Mobile App
    • Introduction
    • Calibrator
      • Nybble
      • Bittle
    • Controller
  • Desktop APP
    • Introduction
    • Firmware Uploader
      • NyBoard
      • BiBoard V0
      • BiBoard V1
    • Joint Calibrator
      • NyBoard Preparation
      • BiBoard Preparation
      • Nybble
      • Bittle / Bittle X
        • Bittle (NyBoard)
        • Bittle X (BiBoard V0)
        • Bittle X (BiBoard V1)
      • Bittle X+Arm
        • BiBoard V1
        • BiBoard V0
    • Skill Composer
      • NyBoard Connection
      • BiBoard Connection
      • Interface
        • Nybble
        • Bittle / Bittle X
        • Bittle X+Arm
    • Tools
  • Block-based programming
    • Petoi Coding Blocks
      • NyBoard Preparation
      • BiBoard Preparation
    • Block-based Coding Curriculum - Learn Quadruped Robotics for Beginners
    • Python coding mode in Mind+
    • Generic Arduino Uno Blocks
    • Install Mind+ on Chromebook
  • Arduino IDE
    • Upload Sketch for NyBoard
    • Upload Sketch for BiBoard
    • Calibrate the joints with Arduino IDE
    • Serial Monitor
    • C++ Curriculum: Learn Quadruped Robotics for Beginners
    • Install Arduino IDE on Chromebook
  • Free Curriculum
    • 📚Download
  • APIs
    • 🖇️Serial Protocol
      • Feedback servos
      • Nested task queue and signal generator
    • 🐍Python API
    • 🐛8266 MicroPython controller
      • Run MicroPython on ESP8266
      • Setup WebREPL
      • Using the ESP-NOW protocol
    • 🦎8266 Arduino C Controller
    • ©️C++ API
    • 🍓Raspberry Pi serial port as an interface
      • For BiBoard V1
    • 💻Set up Development Environment on Chromebook
    • 🤖ROS
  • Nyboard
    • Overview
    • NyBoard V1_0
    • NyBoard V1_1 & NyBoard V1_2
  • BIBOARD
    • BiBoard V0 Guide
    • BiBoard Extension Hat
    • Demo Applications
      • 1.GPIO port
      • 2.Serial port
      • 3.Analog-digital converter
      • 4.Digital-Analog Converter
      • 5.EEPROM (Electrically Erasable Programmable read only memory)
      • 6.Gyro IMU(MPU6050)
      • 7.Infrared remote control
      • 8.PWM(Pulse Width Modulation)
      • 9.Servo(under construction)
      • 10.Classic Bluetooth serial port SPP
      • 11.Bluetooth low energy (BLE) serial port pass-through
      • 12.File system SPIFFS
      • 13.Add hardware partition configuration option in Arduino IDE
      • 14.Play MP3
      • 15.The usage of Wi-Fi OTA(Over-The-Air)
    • BiBoard V1 Guide
  • Communication Modules
    • Introduction (For NyBoard)
    • USB Uploader (CH340C or CH343G)
    • Dual Mode Bluetooth
    • WiFi module ESP8266
      • ESP8266 + Python Scripts Implement wireless crowd control
  • Extensible Modules
    • Introduction
    • MU Camera
    • Ultrasonic Sensor
    • Light Sensor
    • Touch Sensor
    • Gesture Sensor
    • PIR Motion Sensor
    • IR Distance Sensor
    • Voice Command Module
    • Petoi AI Vision Module
    • Advanced development and application of AI vision modules
      • Model Training
      • Model quantification
      • Model deployment
      • Training on the COCO DIY dataset
    • Robot Arm
      • Upgrade your older Bittle/Bittle X for the robotics arm gripper
    • 🎮Joystick with Micro:Bit
  • Applications
    • Melody Creation
    • Skill Creation
    • OpenCat Imitation Tutorial
    • Programmable Puppet Character
    • Tutorial for simulating Bittle In Isaac Sim
  • History
    • Upload Sketch For NyBoard (software 1.0)
  • Technical Support
    • 💾Supporting Application and Software
    • 🔧Burn Bootloader for NyBoard
    • 🛠️Useful Tools
    • 🔋Battery
  • Useful Links 🕸
    • 🔭Home of Petoi Robots
    • 🛒Shop Coding Robots
    • 💿GitHub of OpenCat
    • 🎪PetoiCamp (Forum)
    • 📽️Petoi Robot Videos
    • 📬Users' repositories
Powered by GitBook
On this page
  • Prepare to Enter the Calibration State
  • Calibration process
  • 1. Enter the calibration state
  • 2. The rationale for calibration
  • 2.1 Understand the zero state and the coordinate system
  • 2.2 Discrete angular intervals
  • 2.3 Attach body parts to the servos
  • 3. Fine-tune the calibration using the serial monitor
  • 3.1 Joint Control Commands
  • 3.2 Use ‘L’ shaped joint tuner
  • 3.3 Testing and validation
  • 3.4 Install the screws
  • 3.5 Center of mass

Was this helpful?

Export as PDF
  1. Arduino IDE

Calibrate the joints with Arduino IDE

PreviousUpload Sketch for BiBoardNextSerial Monitor

Last updated 2 months ago

Was this helpful?

Prepare to Enter the Calibration State

Please refer to the in the Joint Calibrator of the Petoi Desktop App according to the robot's mainboard.

Calibration process

1. Enter the calibration state

You must plug the servos and external batteries into the mainboard and check the position and direction of all servos.

Send the serial command ‘c’ in the serial monitor to enter the calibration state. Depending on their initial shaft direction, some may travel larger angles until stopping at the middle point. There will be noise coming from the gear system of the servos. You will see a calibration table like the following:

The first row is the joint indexes; the second row is their calibration offsets:

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

Initial values are “-1” or “0” and should be changed by later calibration.

The servos use a potentiometer in the feedback loop for position control. When held at a static position, they tend to vibrate around the target angle. A Parkinson's-like vibration will develop after a short period of use. It won’t affect much during continuous motion. Better servos without these troubles could cost 10 times more, so replacing a failed unit is a more cost-effective solution.

2. The rationale for calibration

2.1 Understand the zero state and the coordinate system

After typing ‘c’ in the serial monitor, with all servos rotated to their zero angles, attach the head, tail, and legs prepared in the previous section to the body. They are generally perpendicular to their linked body frames. The calibration pose is shown below:

If you are building the robot from a kit, install the servo-related components according to the picture above and try to ensure that they are perpendicular to each other (the upper leg is perpendicular to the torso, and the lower leg is perpendicular to the upper leg). Please refer to the related chapter in the user manual for the details:

  • Nybble

Note: Insert the servo-related components directly into the servo output shaft; do not turn the output shaft during this process.

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

The only exception is the tilt angle for the head of Nybble. It’s more natural to say head up, while it’s the result of rotating clockwise.

However, from the right side of the robot's body, the rotation direction's positive and negative are just opposite.

2.2 Discrete angular intervals

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

2.3 Attach body parts to the servos

Install the head

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

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

Install the legs

Install upper leg and lower leg components to the output teeth of the servos after the Bittle is powered on and in the calibrated neutral position. Please keep the torso, upper leg, and lower leg installed vertically as much as possible, and do not install the lower leg backward, as shown in the picture.

3. Fine-tune the calibration using the serial monitor

3.1 Joint Control Commands

For example :

  • c8 6 This means giving the 8th servo an offset of 6 degrees.

  • c0 -4 This means giving the 0th servo(the head) an offset of -4 degrees.

The resolution of the correction amount is 1 degree; do not use decimals.

If you find the absolute value of offset is more significant than 9, you are not attaching the limb closest to its zero states. That will decrease the servo's reachable range on either side. Please take off the limb and rotate it by one tooth. It will result in an opposite but smaller offset.

For example, if you have to use -9 as the calibration value, remove the limb, rotate it by one tooth, and then attach it back. The new calibration value should be around 5, i.e., the sum of their absolute values is 14. Avoid rotating the servo shaft during this adjustment.

Find the best offset that can bring the limb to the zero states. It's a process of trial and error.

After calibration, remember to type ‘s’ to save the offsets. Otherwise, they will be forgotten when exiting the calibration state. You can even save every time after you’re done with one servo.

3.2 Use ‘L’ shaped joint tuner

When watching something, one's observations will change from different perspectives. When measuring length, one always wants to read directly above a referencing ruler.

You must keep a parallel perspective when calibrating Bittle. Use the 'L'-shaped joint tuner as a parallel reference to avoid reading errors. Align the tips on the tuner with the center of the screws in the shoulder and knee joints and the little hole on the tip of the foot. Look along the co-axis of the centers. For each leg, calibrate the shoulder servos (index 8~11) first, then the knee servos(index 12~15). When calibrating the knee, use the matching triangle windows on both the tuner and shank to ensure parallel alignment.

Nybble

Bittle

3.3 Testing and validation

After calibration, type ‘d’ or ‘kup’ to validate the calibration. This will result in Bittle / Nybble symmetrically moving its limbs between the rest and stand states.

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

Take Bittle, for example, as follows:

3.4 Install the screws

After completing the joint calibration, install the center screws to fix the leg parts and servo gears.

3.5 Center of mass

Try to understand how the robot keeps balance even during walking. If you add new components to the robot, distribute its weight symmetrically about the spine. You may also need to slide the battery holder back and forth to find the best balance spot. Because the battery is heavier in the front, you can insert it in a reversed direction to shift the center of mass more toward the back.

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

Please do not force the robot to add heavy objects, which may cause the servos to sweep or get stuck.

The command for fine-tuning calibration (refer to the ) is formatted as cIndex Offset. Notice that there’s a space between cIndex and Offset. The index number of the robot's joints is shown in the pictures below:

For the robotic arm, you can use the serial command "c-2" to the robotic claw joint.

Bittle
serial protocol
auto-calibrate
preparation section
Nybble's Calibration State
Bittle's Calibration State
Nybble
Bittle
Align the upper leg first
Pay attention to the reference edges for the lower leg