A modified mini Kame quadruped robot accessory for Stack-Chan, running on Adafruit Feather ESP32-S3 (no PSRAM) with an 8-channel PWM servo wing. Could also just be a Lego-compatible platform for whatever.
Basically...
..but cute!
- Microcontroller: Adafruit Feather ESP32-S3 (no PSRAM)
- Servo Controller: Adafruit 8-channel PWM Servo FeatherWing (PCA9685)
- Servos: 8x MG90S digital servos
- Battery Monitor:
MAX17048 LiPo fuel gaugeNot viable: will have to work out a setup with a simple voltage divider going to an analog pin on the feather - Physical Design: Based on miniKame quadruped
- 3D printed parts
- M3 machine screws, nuts, and nylock nuts
- F693ZZ flanged bearings
- Lego Technic Pins (part # 2780)
I am redesigning the main body to:
- have a lego-compatible mount on top for StackChan
- allow the top cover to be opened without removing the legs
- provide enough space to use an adafruit 8ch PWM wing with right angle headers
This project contains two PlatformIO firmware modules:
firmware/legs-esp32s3— gait controller for the quadruped bodyfirmware/controller-cardputer— handheld remote for driving and testing
Each folder is a standalone PlatformIO project with its own platformio.ini.
Servo 0: Front Left Hip
Servo 1: Front Left Foot
Servo 2: Back Left Hip
Servo 3: Back Left Foot
Servo 4: Back Right Hip
Servo 5: Back Right Foot
Servo 6: Front Right Hip
Servo 7: Front Right Foot
- Format: 2-byte commands
- Controllers: M5Stack Cardputer, M5Stack Stack-Chan, or any ESP32 device
- Pairing: Auto-accepts commands from any sender (no MAC whitelist)
- Range: ~100m line-of-sight (typical ESP-NOW range)
Command Format:
- Byte 0: Command type (see command table below)
- Byte 1: Command value (typically number of steps)
Example (Arduino):
uint8_t command[2] = {0x02, 5}; // Walk forward 5 steps
esp_now_send(robotMAC, command, 2);- Baud Rate: 115200
- Interactive Commands:
h- Move to home positionz- Zero all servos (90°)w- Walk forward 3 stepsb- Walk backward 3 stepst- Turn lefts- Emergency stopr- Resume from emergency stopc- Enter calibration modeq- Show queue count
| Command | Type | Value | Description |
|---|---|---|---|
| Stop | 0x01 | 0 | Stop movement and return to home |
| Walk Forward | 0x02 | 1-255 | Walk forward N steps |
| Walk Backward | 0x03 | 1-255 | Walk backward N steps |
| Turn Left | 0x04 | 1-255 | Turn left N steps |
| Turn Right | 0x05 | 1-255 | Turn right N steps |
| Moonwalk Forward | 0x06 | 1-255 | Moonwalk forward N steps |
| Moonwalk Backward | 0x07 | 1-255 | Moonwalk backward N steps |
| Jump | 0x08 | 0 | Perform jump animation |
| Shuffle Left | 0x09 | 1-255 | Lateral shuffle left N steps |
| Shuffle Right | 0x0A | 1-255 | Lateral shuffle right N steps |
| Emergency Stop | 0xFF | 0 | Immediate stop all movements |
The robot uses an oscillator-based movement system inspired by the original miniKame. Each servo is controlled by a sinusoidal oscillator with configurable:
- Amplitude: Range of motion in degrees
- Offset: Center position offset
- Phase: Phase shift for gait coordination
- Period: Time for one complete cycle
- Walk - Standard alternating tripod gait for forward/backward movement
- Turn - In-place rotation using differential leg movement
- Moonwalk - Smooth sliding motion (Michael Jackson style!)
- Lateral Shuffle - Side-stepping movement
- Jump - Quick up-down animation
- Queue Size: 16 commands
- Processing: First-come-first-served (fair arbitration)
- Priority: Emergency stop (0xFF) interrupts immediately
- Low Battery Threshold: 3.4V or 20% charge
- Behavior: Restricts movement commands when battery is low
- Monitoring: Checks every 10 seconds
- Status: Reported via serial output or can be polled from ESP-NOW
Trim values can be saved to non-volatile storage (Preferences):
// Trim values stored as:
preferences.putInt("trim0", value); // -50 to +50 typical range
...
preferences.putInt("trim7", value);- numbers 0..7: select a servo
- +/-: jog servo forward or back
- p: print currently selected servo
TODO: Implement interactive calibration interface via serial
# Using PlatformIO
pio run -t upload
# Monitor serial output
pio device monitor// From any ESP32 controller (Cardputer or Stack-Chan)
uint8_t command[2] = {0x02, 5}; // Walk forward 5 steps
esp_now_send(robotMAC, command, 2);// Turn left 3 steps
uint8_t command[2] = {0x04, 3};
esp_now_send(robotMAC, command, 2);// Jump
uint8_t command[2] = {0x08, 0};
esp_now_send(robotMAC, command, 2);- Emergency Stop: Stops all movements immediately
Low Battery Protection: Restricts movement on low batteryNot yet implemented- Command Queue Overflow: Warns if queue is full
- Servo Limits: PWM values clamped to safe range (204-410)
- Interactive calibration interface via serial
- MAC address whitelist for ESP-NOW security
- EEPROM-based movement sequence storage
- Sensor integration (IMU for balance, ultrasonic for obstacle detection)
- Smooth movement interpolation between gaits
- Custom choreographed dance sequences
- OTA (Over-The-Air) firmware updates
- New battery monitoring using voltage divider to analog pin
- Original miniKame design by Javier Isabel (JavierIH)
- Oscillator-based gait system inspired by Obijuan's work
- Hardware stack by Adafruit Industries
This project inherits the Creative Commons BY-SA license from the original miniKame project.



