OpenCat: build, wire, calibrate, program and walk your quadruped
OpenCat is Petoi's open-source framework for small programmable quadruped robots. It provides firmware for servo coordination, posture and gait skills, IMU processing and serial commands. Choose the hardware revision before downloading firmware: an original NyBoard Bittle or Nybble does not use the same controller software as an ESP32 BiBoard Bittle X or Nybble Q.



1. Identify the correct robot and firmware
| Robot | Typical hardware | Firmware family |
|---|---|---|
| Original Petoi Bittle | 9 actuated DOF: 8 leg servos and one head servo. NyBoard / ATmega328P in the original generation. | OpenCat-Quadruped-Robot |
| Original Petoi Nybble | 11 actuated DOF: 8 leg servos, 2 head servos and 1 tail servo; traditionally a wooden frame and NyBoard. | OpenCat-Quadruped-Robot |
| Bittle X and Nybble Q | ESP32/BiBoard-based models; exact servo and accessory arrangement depends on hardware revision. | OpenCatEsp32-Quadruped-Robot |
Original Bittle and Nybble builds have different bodies, servo layouts and firmware settings. Do not mix a NyBoard build guide with a BiBoard firmware image.
2. Parts and tools
| Part | Role |
|---|---|
| Bittle or Nybble mechanical frame | Supports the body and four leg assemblies. |
| Eight leg servomotors | Drive two powered joints on each leg. |
| Additional servos | Head and tail on models that include them. |
| NyBoard or BiBoard | Runs matching OpenCat firmware. |
| IMU | Measures body tilt. |
| Petoi-compatible battery | Supplies the correct model-specific voltage and current. |
| USB serial interface | Uploads firmware and communicates with the robot. |
| PC with Arduino IDE, Python and Git | Programs, calibrates and diagnoses the system. |
| Hex keys, screwdrivers, caliper and multimeter | Mechanical assembly and electrical inspection. |
For a scratch build, also obtain the exact model's bill of materials, servo horns, fasteners, structural parts, cabling and board-specific wiring drawing. Open-source firmware does not imply a complete, interchangeable set of mechanical manufacturing files for every commercial revision.
3. OpenCat software control diagram
4. How the four legs work
Each leg has an upper and a lower powered joint. Coordinated motion lifts the foot, advances it and brings it back into ground contact. Servo neutral points, index order and allowable angles depend on the installed Petoi model.
5. Mechanical assembly, step by step
- Prepare the chassis. Sort the wooden parts used by classic Nybble or the corresponding Bittle frame parts. Identify front/rear and left/right components.
- Fit servo bodies. Mount each leg actuator in the specified position without forcing the shafts.
- Center servos before fixing horns. Enter the documented calibration state. Fit each horn and leg segment to the appropriate neutral alignment before tightening.
- Build the four legs. Install the mirrored upper and lower links. Check that each leg moves within its mechanical range without rubbing the frame.
- Mount the controller. Fit the NyBoard or BiBoard on its supports with the IMU in the orientation specified by the assembly manual.
- Route cables. Separate moving links from wiring and provide slack for every planned joint motion.
- Install battery and accessories. Attach only the compatible battery, head, tail, range sensor and communication modules specified for the chosen robot.
- Inspect without power. Verify connections, fasteners, servo-horn alignment and free motion before the first motorized movement.
6. Power and signal wiring diagram
Classic NyBoard designs use an ATmega328P microcontroller and a PCA9685 PWM driver. Power must be disconnected before changing motor connectors. Incorrect polarity or a misaligned servo plug can damage electronics.
7. Windows software installation
- Install Arduino IDE and select the correct board support package.
- Install Python 3, Git and the matching USB serial driver when required.
- Install Petoi Desktop App for firmware upload, joint calibration and motion composition.
- Determine whether the robot is NyBoard or ESP32/BiBoard.
cd $HOMEDesktop
git clone https://github.com/PetoiCamp/OpenCat-Quadruped-Robot.git
cd OpenCat-Quadruped-Robot
dir
# ESP32/BiBoard family: use a separate checkout
cd $HOMEDesktop
git clone https://github.com/PetoiCamp/OpenCatEsp32-Quadruped-Robot.git
cd OpenCatEsp32-Quadruped-Robot
8. Flashing NyBoard with Arduino IDE
Open OpenCat.ino. For a classic Bittle or Nybble choose the model and NyBoard revision that correspond to the physical controller. The following snippet illustrates the mutually exclusive model definitions, not a replacement for the full firmware configuration.
// Choose the installed robot:
// #define NYBBLE
#define BITTLE
// Select the correct physical board revision:
// #define NyBoard_V1_0
// #define NyBoard_V1_1
For a classic NyBoard setup, Arduino Uno / ATmega328P, the connected serial port, 115200 baud and no line ending are commonly documented. Check the official instructions for earlier board revisions.
- Choose the board and serial port in Arduino IDE.
- Use the repo's initial configuration procedure. Where that release documents
MAIN_SKETCH, comment it for the configuration upload. - Upload, open Serial Monitor and follow the prompts for joint-offset reset on a new build. Do not reset an already-calibrated robot unless necessary.
- Calibrate the IMU following the orientation and stability instructions.
- Reactivate
MAIN_SKETCHwhen required by that release; compile and upload the main program.
// Configuration phase, on releases that use this switch:
// #define MAIN_SKETCH
// Main operation after board setup:
#define MAIN_SKETCH
9. Joint calibration diagram and procedure
In Petoi Desktop App open Joint Calibrator. Position all servos in the calibration state before fixing horns for an unassembled robot. Align upper and lower leg segments as specified for the model and save the individual correction offsets. Avoid forcing the servo shaft while powered. Test every joint on a support before lowering the paws onto the floor.
10. First movement and serial skill commands
| Command | Expected action on supported firmware |
|---|---|
ksit | Sitting pose |
kup | Standing pose |
kbalance | Balance stance |
kwkF | Walk forward |
kwkL | Walk left |
kwkR | Walk right |
ktrF | Trot forward |
d | Rest / release servos |
ksit
kup
kwkF
d
Send one command at a time from the matching serial monitor, after calibration and safety checks. Available skills vary with firmware. The d command may release servo holding torque and cause the robot to collapse; it is not an electrical emergency stop.
11. Install Python and communicate over serial
python -m pip install pyserial
python -m serial.tools.list_ports
Close Arduino Serial Monitor before opening the same COM port from Python. Replace COM3 with the detected port.
import serial
import time
PORT = "COM3"
BAUDRATE = 115200
def send(robot, command, delay=1):
print("Sending:", command)
robot.write(command.encode("ascii"))
robot.flush()
time.sleep(delay)
def main():
with serial.Serial(PORT, BAUDRATE, timeout=1) as robot:
time.sleep(2)
try:
send(robot, "ksit", 2)
send(robot, "kup", 2)
# Enable walking only after successful stand and stop tests.
send(robot, "kwkF", 2)
finally:
robot.write(b"d")
robot.flush()
if __name__ == "__main__":
main()
This example sends serial skills but does not confirm completion or measure travel. Add protocol acknowledgements for an application that requires feedback. The rest command may cause loss of support.
12. Move one joint at a time
The documented m and i serial tokens allow individual and grouped joint-position instructions. These examples require confirming joint indices and joint limits against the installed firmware.
m0 30
i8 -15 9 -20
For a supported single-joint bench test with mechanical support:
import serial
import time
PORT = "COM3"
with serial.Serial(PORT, 115200, timeout=1) as robot:
time.sleep(2)
robot.write(b"m0 10")
robot.flush()
time.sleep(1)
robot.write(b"m0 0")
robot.flush()
13. Compose your own skill sequence
Use Petoi Skill Composer for pose frames and their durations. A simple serial sequence can send preinstalled skills in order:
import serial
import time
PORT = "COM3"
actions = [("ksit", 2), ("kup", 2), ("khi", 2), ("ksit", 2)]
with serial.Serial(PORT, 115200, timeout=1) as robot:
time.sleep(2)
try:
for command, seconds in actions:
robot.write(command.encode("ascii"))
robot.flush()
time.sleep(seconds)
finally:
robot.write(b"d")
robot.flush()
The khi greeting skill must be available on your robot's installed firmware. The script does not parse serial acknowledgements.
14. Arduino C++ serial command example
The following is a conceptual program for a separate Arduino-compatible controller sending serial messages to a supported OpenCat device. It is not a replacement for the main OpenCat firmware.
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("ksit");
delay(2000);
Serial.print("kup");
delay(2000);
Serial.print("khi");
delay(2000);
Serial.print("d");
while (true) delay(1000);
}
On a real external controller, validate serial voltage compatibility, communication wiring, timing and command framing before connecting hardware.
15. Add an obstacle sensor
def choose_command(distance_cm):
threshold_cm = 20.0
if distance_cm < threshold_cm:
return "d"
return "kwkF"
distance = 35.0 # Simulated measurement
print(choose_command(distance))
This Python function only demonstrates decision logic. It is not connected to an actual distance sensor. The real system requires sensor-specific wiring and drivers, error handling and a safe fallback when readings disappear.
16. Troubleshooting
| Symptom | Checks |
|---|---|
| No USB serial port | Confirm data-capable cable, USB driver and COM/tty port. |
| Arduino upload fails | Verify board selection, serial port and firmware revision. |
| One servo is silent | Disconnect power; inspect connector orientation, output index, cabling and driver supply. |
| Leg moves backward | Check horn position, mirrored orientation and saved offsets. |
| Robot falls when standing | Use a support; verify all leg joint positions, IMU orientation, supply and servo calibration. |
| Unstable gait | Check leg contact, calibration, obstruction and power condition. |
| Python cannot open COM port | Close other serial monitors; enumerate current ports and permissions. |
| Wrong ESP32 firmware | Confirm BiBoard revision and install its matching OpenCat ESP32 release. |
# Windows
python -m serial.tools.list_ports -v
# Linux
ls /dev/ttyUSB*
ls /dev/ttyACM*
python3 -m serial.tools.list_ports -v
17. First-walk checklist
- Correct Petoi model and electronics revision identified.
- Mechanical frame and four mirrored legs inspected.
- Servo cables mapped against the matching board diagram.
- Power connections and battery specification verified.
- Correct OpenCat firmware installed.
- IMU and servo calibration complete.
- Sitting and standing verified with support.
- Stop behavior checked and clear floor available.
18. Limitations and technical references
The final schematic with actual servo pin numbers, battery voltage and connector polarity depends on the exact NyBoard or BiBoard generation. Do not substitute these functional illustrations for manufacturing documents. The Python and C++ examples are instructional and have not been tested on a physical OpenCat robot during this update.
Petoi's documented development resources include OpenCat NyBoard and OpenCat ESP32 repositories, joint calibration, the serial protocol, Python API and Skill Composer. Check the installed firmware's supported token list before commanding an unfamiliar skill.
Complete practical guide: OpenCat
OpenCat runs on several Petoi hardware generations. The firmware, servo configuration and serial interface must be chosen for the exact board and body rather than copied from another robot.
1. Files, parts and fabrication
- Identify the Petoi model and board revision, then obtain the corresponding body files, servo set and assembly instructions. Use printed replacements only when specified.
- Fit servo horns at the published neutral angle and install mirrored leg modules. Inspect the cable paths and battery mounting.
- Mount the controller and IMU in the instructed orientation; keep the stop and power control reachable.
2. Software installation and configuration
- Install the compatible Arduino IDE, board definitions and OpenCat firmware or the supported updater. Select NyBoard or BiBoard according to the physical board.
- Use the project's serial monitor or app to check the board response. For the documented NyBoard interface choose 115200 baud and no line endings.
- Complete the board-specific calibration procedure and retain the saved offsets before selecting a skill.
Commissioning diagram
- 1Skill command
- 2Board firmware
- 3Servo offsets
- 4Four leg movement
- 5IMU feedback
Mermaid diagram source
flowchart TD
N0["Skill command"]
N1["Board firmware"]
N2["Servo offsets"]
N3["Four leg movement"]
N4["IMU feedback"]
N0 --> N1
N1 --> N2
N2 --> N3
N3 --> N43. Power-on preparation and first movement
- Support the robot with all paws clear. Check each joint and neutral posture using the documented calibration interface.
- Inspect the IMU response while gently changing body orientation. Confirm the saved offsets and stop method.
- For the matching NyBoard firmware, the documented kbalance command selects a stationary balance skill after calibration.
4. Programming exercise
These are serial-monitor settings and a board-specific skill command, not a shell script. Use only on the documented NyBoard version with the robot supported.
Baud: 115200
Line ending: None
# After calibrated, supported startup:
kbalanceThe robot should adopt the documented stationary pose; inspect paw alignment without releasing support. If the skill is unknown, review the installed firmware and version.
5. Progress to practical operation
- Confirm stationary posture and stopping before lowering the body.
- Select a slow documented gait skill and test a short straight route on a flat clear floor.
- Use the board-matched skills and limits for other movements. Do not transfer gait commands from a different Petoi firmware generation.
6. Software and hardware diagnostics
- Serial monitor gives no response
- Check the selected port, baud and board firmware.
- Pose skewed
- Inspect horn centring and saved offsets.
- Wrong correction direction
- Review IMU installation and calibration.
Technical basis: Petoi OpenCat firmware, serialMaster and board-specific setup. Programming examples are identified as simulation, offline analysis or documented interface instructions. No physical commissioning test is claimed.
Build Bittle or Nybble and configure NyBoard
Kit-based quadruped, board-specific build
Select Bittle or Nybble and match NyBoard or ESP32 electronics before downloading firmware.
From parts to first test 5 steps
Order the matching kit or components
Use Petoi's documentation to identify the correct chassis, servo set, battery and controller revision. Confirm which structural STL files are actually provided for that model.
Reference 3 ↓Configure the controller
For the original NyBoard branch, use OpenCat.ino and choose the correct board and robot model; disable MAIN_SKETCH during initial configuration as specified by the README.
Reference 4 ↓Calibrate servos and IMU
Use the serial setup at the documented 115200 baud with no line endings for the applicable NyBoard version. Keep the IMU level and record each servo offset before fitting the legs.
Reference 4 ↓Assemble the chassis
Mount the calibrated servos and linkages in the illustrated orientation and route cables before closing the body.
Reference 3 ↓Upload and test the main firmware
Restore MAIN_SKETCH after setup, or follow the separate ESP32 workflow if applicable. Test the neutral posture on a support before sending a short gait command.
Reference 1 ↓
Parts, files and official manuals 4 references
Petoi quadruped servo calibration
Practical implementation notes for OpenCat. Use the exact hardware and software revision specified in the project documentation.
Tools and equipment
- Hex keys
- small screwdriver
- USB adapter
- Arduino IDE or Petoi Desktop App
- multimeter
- supported battery
Component illustration
- 1Body board
- 2Hip servo
- 3Knee servo
- 4Foot
Control architecture
- 01Serial / app
- 02OpenCat firmware
- 03Servo offset mapping
- 04Legs + IMU
Mechanical preparation and assembly
Identify the exact Petoi robot and board revision. Check the horns against the neutral alignment diagram, then install the servo modules and mirrored legs. Verify cable strain relief before fitting the shell.
Electrical setup and calibration
Use the correct NyBoard or BiBoard firmware path. For NyBoard configure the model in OpenCat.ino and follow the documented calibration procedure. Record offsets with the body level before tightening horns. Never apply NyBoard settings to an ESP32 board.
Software setup and programming
Upload board-matched firmware with Arduino IDE or the supported updater. Use the serial monitor or Petoi app to check feedback; the serialMaster examples describe skill commands. Start with a stationary pose rather than a gait.
First test and acceptance criteria
On a stand, inspect each leg's direction and confirm the IMU responds correctly. Move to the floor only once the neutral stance is symmetric and the robot can stop on command.
Programming and configuration example
The skill token requests a standing balance posture on a compatible, calibrated OpenCat robot. Keep it supported; check the exact firmware manual before sending.
Serial monitor: select the documented port
NyBoard setup: 115200 baud, no line endings
After calibration: kbalanceTroubleshooting
If the pose is skewed, return to servo horn alignment and stored offsets. If serial commands fail, check whether NyBoard or BiBoard firmware is installed and use the matching interface.
Technical reference: project release documentation. The assembly references above provide the revision-specific drawings and BOM. Examples are editorial walkthroughs or documented commands; they have not been physically tested by TechniaHQRobot.
A family of boards and robots
The legacy OpenCat project uses an Arduino-style sketch to coordinate servos, gaits and an inertial sensor. In its setup instructions the builder selects the Bittle or Nybble model and the matching NyBoard revision before uploading firmware. Those preprocessor choices affect pin assignments, joint counts and the motion profile loaded at startup.
Petoi now directs Bittle X and Nybble Q users to OpenCatESP32. The legacy code remains useful for supported older hardware, but it should not be described as the current firmware for every Petoi robot.
Calibration before any gait
The published procedure separates configuration mode from the main sketch. It includes resetting joint offsets, calibrating the IMU and checking servo alignment. An offset error can leave one foot higher than another even when the gait sequence itself is unchanged.
For teaching, this gives a concrete experiment: compare the commanded gait with the same robot before and after joint-offset calibration, keeping the surface and power source fixed. That experiment is suggested here; it has not been performed by this site.
Do not confuse code availability with every product release
The repository also mentions later Petoi hardware. It says the Quaddle source had not been published in the referenced announcement. A future or proposed release should not be counted as available open-source firmware until the files and license are public.
Researchers using ROS, computer vision or learning tools need to confirm which additions are maintained in the branch matching their controller. Community integrations do not automatically ship with the base firmware.
Servo offsets, Arduino firmware and chassis files
Answers are based on published source material and project documentation. Their order does not represent search volume.
01Why does the robot move with wrong joint angles?
Run the joint calibration to set servo offsets rather than assuming factory horn positions. Use the documented serial or app calibration workflow.
Sources Official project source
02Which board settings must be selected before uploading?
OpenCat.ino has separate BITTLE/NYBBLE and NyBoard revision defines. Use the model physically installed, then upload the matching sketch.
Sources Official project source
03Why does the serial monitor not show setup prompts?
Use 115200 baud and no line ending and verify the USB-to-serial driver, correct COM port and configuration-mode build.
Sources Official project source
04Can the original NyBoard firmware run unchanged on ESP32?
No. OpenCatESP32 has a separate repository and board-specific definitions. Follow its own installation and calibration instructions.
Sources Official project source
05Where can I print my own Bittle or Nybble shell?
Petoi's public software repository covers the controller and points to hardware documentation, but does not confirm a complete ready-to-print revision-matched STL kit for every commercial robot.
Sources Official project source
06What does the AUTO_INIT option do?
It skips some prompts and triggers IMU calibration in the firmware setup. Use it only after checking the manual calibration sequence.
Sources Official project source
OpenCat: parts cost, software updates and maintenance
This practical ownership section complements the original assembly and programming instructions. Public files do not guarantee that all components can still be purchased or that every build is supported.
| Item | Project record |
|---|---|
| Cost record / BOM target | Not confirmed; depends on chosen Petoi robot or DIY build |
| Software licence | MIT (OpenCat-Quadruped-Robot repository) |
| Hardware licence | Check each board, chassis and accessory design before reuse |
| Simulation availability | Community robotics and reinforcement-learning integrations; no single bundled simulation confirmed |
| Build difficulty | Intermediate |
How to obtain the robot or its parts
Use the OpenCat documentation and hardware release to identify whether an assembled product, kit or self-sourced parts are offered. Price the matching revision, not a photograph or an old bill of materials. Include actuators, controller, supply, wiring, tools, fabrication, shipping, tax and spare parts. A historical BOM target is not a current delivered quote.
- Project documentation
- Source repository and version history
- CAD / fabrication files
- Revision-specific workshop source
How the hardware and software work together
Mechanical path: Body board → Hip servo → Knee servo → Foot.
- Serial / app
- OpenCat firmware
- Servo offset mapping
- Legs + IMU
Feedback, fault detection and the approved stop function constrain the command path.
Upload board-matched firmware with Arduino IDE or the supported updater. Use the serial monitor or Petoi app to check feedback; the serialMaster examples describe skill commands. Start with a stationary pose rather than a gait.
Install, update and recover the software
Keep the exact hardware revision, repository commit, operating system, dependencies, controller firmware and calibration in a local build manifest. Read the project’s setup instructions before installing. Use an isolated environment and a separate checkout for upgrades; compare release notes, regenerate only the documented configuration, and first repeat a simulation or read-only test. Back up calibration and original firmware files where the project supports it. Restore only a documented compatible release if the new version fails.
Project-specific verification: On a stand, inspect each leg's direction and confirm the IMU responds correctly. Move to the floor only once the neutral stance is symmetric and the robot can stop on command.
Power, battery replacement and cycle life
Use the battery holder and chemistry specified for the chosen OpenCat robot and control board; do not assume all Petoi and DIY configurations share chargers.
Battery cycle life and robot service life are different. Equivalent full cycles (EFC) can be estimated as cumulative discharged energy (Wh) divided by initial usable pack energy (Wh). State of health (SOH) is measured usable capacity divided by baseline usable capacity × 100%, under comparable conditions. Example only: 1,800 Wh discharged from a 600 Wh reference pack equals 3 EFC; neither number is a specification for this robot. Ask for the manufacturer’s cycle rating, temperature limits, capacity-retention criterion and warranty. Do not use an arbitrary percentage as a replacement threshold.
Common problems, wear and service plan
| When | Inspection and evidence |
|---|---|
| Before operation | Check foot pads, servo horns, IMU orientation and board revision; keep the correct skill and calibration files for that controller. |
| After a fault or impact | Use the correct NyBoard or BiBoard firmware path. For NyBoard configure the model in OpenCat.ino and follow the documented calibration procedure. Record offsets with the body level before tightening horns. Never apply NyBoard settings to an ESP32 board. |
| After software or parts change | Record versions and replaced part serials; compare the same approved test with the earlier baseline. Stop on new errors or unexpected movement. |
| At manufacturer service intervals | Use the documented interval and authorized service procedures. No universal calendar or lubricant is assumed. |
| At end of service | Ask about spare-part availability, data removal, battery take-back and local electronics recycling. |
What is not established by the published files
The project documentation must provide any claimed rated service life, battery cycle endurance, duty limits, warranty and repair intervals for the exact hardware. Without a cited endurance test, report those values as not established, not zero and not an estimate. For a DIY build, keep a parts-replacement log and report conditions when measuring reliability.
Original documentation
- Mechanical design and printable availability
- Official project source
- Official project source
- Official project source
Found a changed specification? Submit a correction with its source ↗