12. BiBoard Configuration

12.1. Read the user manual

Read the user manual for BiBoard Quick Start Guide.

12.2. Set up BiBoard

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

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

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

12.2.3. Modify code files

Download the BiBoard package.
  • In file (for Windows): C:\Users{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\tools\sdk\esp32\include\config\sdkconfig.h append
1
#define CONFIG_DISABLE_HAL_LOCKS 1
Copied!
to the end. or replace it with the file in this folder (BiBoard\ESP32config\sdkconfig.h).
  • Replace (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).

12.2.4. Add hardware partition

12.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 uploading the sketch (BiBoard\BiBoard.ino), you need to open the serial monitor and follow the prompts for the first time. Then you can calibrate the joints and imu. The joint indexes are configured in the same order as NyBoard, though the BiBoard only has 12 pins. You can find more features in the ChangeLog.md (BiBoard\ChangeLog.md).
The BiBoard has built-in Bluetooth and you can connect it with the new Android app:

12.2.6. Initialization

When the newly assembled Bittle is powered on, please connect the serial port to the computer, open the serial monitor window, and complete the program initialization process:
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 to calibrate the servos with a fresh start (all offsets are set to zeros).
1
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n):
Copied!
Type ‘Y’ to the question, which means to calibrate the MPU6050, i.e. the gyro/accelerometer sensor.
Put the robot FLAT on the table and don't touch it during calibration.
Sometimes the program could halt at the connection stage. You can close the serial monitor and reopen it, or press the reset button on BiBoard, to restart the program.
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!
All of Bittle's servos will rotate to the calibration states (zero angles) and stop moving. Then the serial monitor window will print out "Ready!"
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.
Please refer to chapter 6 📐 Calibration and Final Assembly for the complete calibration process.
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!