BiBoard Configuration

1. Read the user manual

Read the user manual for BiBoard Quick Start Guide.

2. Set up BiBoard

2.1. Add URL in Arduino->Preferences->Additional Boards Manager URLs

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

2.2. In Boards Manager, search ESP32 and install the 2.0.* version

2.3. Modify code files

Modify the following files after downloading the BiBoard package:

sdkconfig.h

  • For Windows:
C:\Users\{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\tools\sdk\esp32\include\config\sdkconfig.h
  • for Mac:
/Users/{username}/Library/Arduino15/packages/esp32/hardware/esp32/2.0.2/tools/sdk/esp32/include/config/sdkconfig.h
Append a line of code at the end of the file:
1
#define CONFIG_DISABLE_HAL_LOCKS 1
Copied!
Or replace with BiBoard\ESP32config\sdkconfig.h.

esp32-hal-i2c-slave.c

  • For Windows:
C:\Users\{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\cores\esp32\esp32-hal-i2c-slave.c with the file in this folder (BiBoard\ESP32config\esp32-hal-i2c-slave.c).
  • For Mac:
/Users/{username}/Library/Arduino15/packages/esp32/hardware/esp32/2.0.1/cores/esp32/esp32-hal-i2c-slave.c
Replace with BiBoard\ESP32config\esp32-hal-i2c-slave.c.

2.4. Add hardware partition

2.5. Compile and upload the sketch

Modify the device type macro definition in BiBoard.ino according to the device type.
1
#define BITTLE //Petoi 9 DOF robot dog: 1 on head + 8 on leg
2
//#define NYBBLE //Petoi 11 DOF robot cat: 2 on head + 1 on tail + 8 on leg
3
//#define CUB
Copied!
Modify the motherboard model macro definition in BiBoard.ino according to the motherboard model.
1
#define BiBoard //ESP32 Board with 12 channels of built-in PWM for joints
2
//#define BiBoard2 //ESP32 Board with 16 channels of PCA9685 PWM for joints
Copied!
After the modification is completed, you can click the upload button to upload BiBoard.ino, and the changes in the program will be automatically saved.

2.6. Initialization

When the newly set BiBoard is powered on, it needs to connect the serial port to the computer, and initialize the joint and gyroscope accelerometer (IMU) in the serial port monitor window.
Make sure to set the serial monitor as 115200 baud rate and no line ending.
You will see several questions:
1
Reset the joints' calibration offsets? (Y/n):
Copied!
Type ‘Y’ to the question, which means resetting all servo corrections to zero.
1
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n):
Copied!
Type ‘Y’ to the question, which means calibrating the MPU6050, i.e. the gyro/accelerometer sensor.
Put the robot FLAT on the table and don't touch it during calibration.
The program starts calibration after playing the melody 6 times.
After the calibration, the program will enter the regular Power On routine covered in the next section.
The details of serial port printing information are as follows:
1
* Start *
2
Scanning I2C network...
3
- I2C device found at address 0x54 !
4
- I2C device found at address 0x68 !
5
- done
6
Set up the new board...
7
// The device name to use when connecting with bluetooth
8
- Name the new robot as: BittleED
9
Reset the joints' calibration offsets? (Y/n):
10
Y
11
12
Initializing MPU...
13
- Testing MPU connections...attempt 0
14
- MPU6050 connection successful
15
- Initializing DMP...
16
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n):
17
Y
18
19
Put the robot FLAT on the table and don't touch it during calibration.
20
- Calibrating the Inertial Measurement Unit (IMU)...
21
>..........>..........
22
MPU offsets:
23
// X Accel Y Accel Z Accel X Gyro Y Gyro Z Gyro
24
//OFFSETS 3752, -968, 942, 170, 76, 21
25
- Enabling DMP...
26
- Enabling interrupt detection (Arduino external interrupt 26)...
27
- DMP ready! Waiting for the first interrupt...
28
Bluetooth name: BittleED
29
Waiting for a client connection to notify...
30
Setup ESP32 PWM servo driver...
31
Ready!
32
Copied!
The main program of Bittle judges whether it has been initialized by comparing the BIRTHMARK in the EEPROM, and will not enter the initialization process again when it is turned on next time.
If you need to recalibrate the servo offsets or recalibrate the IMU (MPU6050), you can modify the following configuration macro definitions in the BiBoard.ino then recompile and upload the sketch.
1
//change this mark to any other character if you want to reset
2
//the Bluetooth name and calibration values in the EEPROM
3
#define BIRTHMARK 'x'
Copied!

2.7. Power on

  • If you power on the robot upside down, it will enter the calibration state:
The servos can point in any direction when the robot is turned off. After receiving the calibration signal, all the servos will rotate to their calibration positions (zero angles) and stop moving. We call this position Bittle's "calibration pose". The Bittle remains in the calibrated position until the first user input (infrared, Bluetooth or serial) is received.
Then you can attach body parts to the servos according to the calibrated position and use the ‘c’ commands to set the fine-calibration values. Although the BiBoard 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:
Please refer to chapter 6 📐 Calibration and Final Assembly for the complete calibration process.
  • If you power on the robot and it is upright (with its back upward), the robot will start from the "rest" posture (fold the legs and unlock the servos).

2.8. Configuration with App

The BiBoard has built-in Bluetooth and you can connect it with the new Android app:
You can check the update history and added features in ChangeLog.md (BiBoard\ChangeLog.md)