roboPet
A four-legged robot I’m building to learn mechatronics, on a Raspberry Pi Pico and a Pi Zero 2W. The 8-servo frame is printed and partly assembled.
roboPet concept film


Concept animation made with Google Veo from a Gemini render.
Face
An
SSD1306OLED draws the eyes. It has shown test faces and a live orientation cube from the IMU.Controllers
A Raspberry Pi Pico runs the real-time loop: servo PWM and the
MPU6050IMU. A Pi Zero 2W will take the camera, audio and RC. A UART link joins the two boards.Power
A salvaged 3-cell laptop pack feeds two
XL4016buck converters, about 7.2 V for the servos and 5.0 V for logic. I lost two servos, most likely to overvoltage: many MG996R clones are rated for only 4.8 to 6.0 V.Legs
The MVP frame takes eight
MG996Rservos, two per leg. The full design uses twelve, three per leg.
The MVP frame is printed and partly assembled.
Build log on GitHubWhere it stands
Some servos, the IMU and the Pico are mounted on the MVP chassis. The Zero 2W has a mount but is not installed.
On the bench, the Pico has held two servos level from the IMU with a PID loop. Walking still needs inverse kinematics for each leg and a gait, and neither is written yet.
The film above and the parts view below show the planned robot as a concept render, not the printed frame.
Parts
The planned design in three.js. The printed MVP frame has 8 of 12 servos and does not walk yet; geometry is approximate.Every subsystem and part in the planned build.


Build log
Newest first, from the devlog in the roboPet repository, with what broke.
Designed the MVP chassis in Onshape, printed it on the A1 Mini and started bolting parts on.
Built a servo tester on an old ESP32 so I can check each
MG996Rbefore mounting it. I had already lost two servos on the 7.2 V rail.MG996Rclones are often rated for only 4.8 to 6.0 V, so I'm looking at bringing the rail down toward 6 V.Then, while wiring a second servo to the tester, I swapped VCC and GND with the power on. The ESP32 DevKit smoked and won't boot, and the servo is probably dead too. Next is a reverse-polarity diode on servo VCC.
Gave the OLED its own I2C bus and drew a live 3D orientation cube from the
MPU6050. Full-frame writes timed out on the breadboard until I split them into 256-byte chunks.Later that day I got the live PID-tuning dashboard running between the Zero and the Pico over USB serial. Start commands kept getting lost. Logging the lines I had been throwing away showed why: under servo load a brownout dropped the Pico's USB every 10 to 40 seconds and restarted the program.
Moved from one ESP32 to two boards. I flashed MicroPython v1.23.0 to the Pico over SWD and reached its REPL wirelessly through the Zero once I crossed TX and RX on the UART.
Blocking calls in the ESP32's web server froze its control loop, so a two-servo tracker stalled and fell out of sync with its web page. I rewrote it as a non-blocking state machine with time-delta kinematics and held servo updates to 50 Hz.
Built and tuned the power system first. Then I booted an ESP32 from the 5.0 V rail, got the LED working and drew the first faces on the OLED, inspired by the Sesame robot.
In Onshape


Bill of materials
- Real-time board
- Raspberry Pi Pico running MicroPython
- Main board
- Raspberry Pi Zero 2W, for the camera, audio and RC
- Link
- UART between the two boards
- Servos
- MG996R, eight on the MVP frame, twelve planned
- IMU
- MPU6050
- Face
- SSD1306 OLED, 128 by 64
- Status light
- One WS2812 LED
- Power
- Salvaged 3-cell laptop pack, two XL4016 buck converters at about 7.2 V and 5.0 V
- Frame
- PLA, printed on a Bambu A1 Mini