Editor’s desk

Building a Robot Dog on an ESP32: What the Petoi BiBoard and OpenCat Offer Beginners article cover

Building a Robot Dog on an ESP32: What the Petoi BiBoard and OpenCat Offer Beginners

The Petoi BiBoard is an ESP32 board made for walking robots, with up to twelve servo outputs and a motion sensor, and the open-source OpenCat framework handles gaits and balance so you can focus on behaviour.

Walking robots look hard, and they are. Each leg needs several motors moving in the right order, the body has to stay balanced and the whole thing must react when it slips or gets pushed. Writing all of that from nothing is a big job. That is why a board and framework built for exactly this job are so useful for beginners.

The Petoi BiBoard is an ESP32-based development board designed for multi-joint robots. It has up to twelve PWM servo outputs built in, an onboard motion sensor for balance, wireless connectivity, expansion ports and audio features. It is the controller for Petoi's current robot dog and robot cat kits. Most importantly, it runs OpenCat, an open-source framework for four-legged robots that has been developed since 2016 and is used in schools, universities and maker spaces.

This guide explains what the board and framework do, how a walking robot works in plain words, what you need and how to start, with help from AI coding tools.

What OpenCat does

OpenCat handles the hard parts of a four-legged robot: coordinating gaits, controlling the servos and using the motion sensor to keep balance. It can be programmed in C and C++, in Python and with block-based coding, which makes it reachable for different skill levels.

The ESP32 version, called OpenCatESP32, runs on the BiBoard. The project explains why it moved from the older board, which used a small ATmega chip, to the ESP32: a dual-core processor at 240 MHz handles servo timing and other work at the same time, Wi-Fi and Bluetooth are built in, up to twelve servos can be driven for full twelve-joint designs and it still works with the Arduino IDE.

How a walking robot works in plain words

A servo is a small motor that moves to an angle you ask for and holds it.

A pose is a list of angles, one for each servo. Standing is one pose. Sitting is another.

A gait is a sequence of poses played in order, many times per second. Walking, trotting and turning are each a gait.

Balance uses the motion sensor, often called an IMU, which measures tilt and movement. When the body leans too far, the controller adjusts the leg angles to correct it.

Behaviours combine all of this. A robot might sit when it hears a command, stand up when tilted over or walk forward when a button is pressed.

OpenCat ships with a set of poses, gaits and behaviours, so a new robot can stand and walk before you write any code.

What you need

The simplest path is one of Petoi's kits, which come with the frame, servos and BiBoard. Building from a kit means the mechanical parts already fit and the servo directions match the software.

If you build your own frame, you will need the BiBoard, servos of the right size and strength, a battery pack that can supply enough current for many servos moving at once, and a frame, which you can 3D print.

A computer with the Arduino IDE and the ESP32 board package. The project lists the exact board settings to use, such as the ESP32 Dev Module with specific flash and partition options.

Getting started

Assemble the kit following Petoi's guide, and calibrate the servos. Calibration tells the software where each joint's zero position really is, which differs slightly from servo to servo.

Upload the firmware with the settings the project lists.

Connect over Bluetooth or USB and send simple commands from Petoi's app or a serial console to make the robot sit, stand and walk.

Then try making your own pose. Change one joint angle at a time and watch the effect.

Using AI coding tools

Robotics code has a lot of numbers that mean physical things, and an AI code editor is good at explaining them. Open the OpenCatESP32 repository and ask the agent where the poses and gaits are stored, how a gait is played back and how the motion sensor feeds into balance.

Then use the agent to build behaviours on top. For example:

Ask it to write a Python script on your computer that sends serial commands to make the robot do a short routine: stand, wave, sit.

Ask it to add a new command that tilts the head when the robot hears a sound, if your model has a microphone.

Ask it to help you design a new pose by describing it in words, such as a play bow with front legs low and back legs high, then test and adjust the angles by hand.

Always test new motions with the robot held in the air or on a soft surface. A wrong angle can push a servo against the frame and damage it.

Adding AI behaviour

The ESP32 itself is busy controlling legs. For voice or vision, many builders add a second device. The BiBoard has expansion ports and supports a voice command module and Raspberry Pi connections on some versions. A Raspberry Pi or a phone can run speech recognition or a vision model and send simple commands such as sit or walk to the BiBoard. You can also connect a language model, so you speak in plain words and the model turns your request into a list of commands the robot understands.

Petoi has also announced a smaller robot that uses only four servos with position feedback, which allows a puppet mode where you move the legs by hand and record the motion. The company says its source code is not public yet.

Pitfalls

Power. Twelve servos moving at once draw a lot of current. Weak batteries cause resets, jerky motion and brownouts. Use the recommended battery and keep it charged.

Calibration. Skipping calibration leads to robots that lean, stumble or walk in circles.

Servo damage. Commands that push past a joint's range can strip gears. Test new code with the robot lifted.

Wrong repository. The original OpenCat repository targets the older board. For the BiBoard, use OpenCatESP32.

Heat. Servos warm up quickly when holding heavy poses. Give the robot rests.

Variations

Teach the robot new tricks by recording poses and stitching them into a routine.

Add a camera on a companion board and have it follow a coloured ball.

Control it from a web page served over Wi-Fi.

Use the same board for other multi-joint machines, such as a small robot arm or a walking hexapod with fewer joints per leg.

The short version

The Petoi BiBoard is an ESP32 board built for walking robots, with up to twelve servo outputs, a motion sensor and wireless links, and it runs the open-source OpenCatESP32 framework that handles gaits and balance. Start with a kit, calibrate the servos, use the listed Arduino IDE settings and learn poses and gaits before writing behaviours. Use an AI coding tool to explain the code and script new routines, test every new motion with the robot lifted and add a second device for voice or vision.

Project resources: https://github.com/PetoiCamp/OpenCatEsp32-Quadruped-Robot https://github.com/PetoiCamp/OpenCat