A 3D-printed hexapod robot, designed and built from scratch: mechanics, electronics, and firmware.
Atlas is a hexapod robot with 6 legs and 3 degrees of freedom per leg: coxa, femur, and tibia. That gives the robot 18 servos in total.
The project is being developed step by step. The current firmware validates basic servo control on an ESP32 before moving to full single-leg inverse kinematics and, later, complete gait control.
Current phase: single-servo validation.
The firmware currently drives one coxa servo connected to GPIO 18. The servo sweeps smoothly between 45° and 135°, using a standard 50 Hz servo PWM signal.
The motion is non-blocking: the main loop remains available for future servos, sensors, and control logic.
| Stage | Material | Reason |
|---|---|---|
| Prototyping | PLA | Fast, cheap, and easy to print while iterating on geometry |
| Final build | ASA | Higher mechanical, thermal, and UV resistance |
- Microcontroller: ESP32
- Current test servo: SG90 9G Micro Servo
- Future servo driver: PCA9685 PWM driver over I2C
- Final build servos: MG996R
- Power supply: dedicated power source for the servos, separated from the ESP32 power input, with common ground
| Servo wire | ESP32 |
|---|---|
| Signal | GPIO 18 |
| V+ | 5V |
| GND | GND |
For real hardware, use an external servo power supply when the load increases. Do not power multiple servos directly from the ESP32.
The firmware is a PlatformIO project located in:
firmware/
The firmware is organized into small components following SOLID principles:
Esp32ServoOutputhandles ESP32Servo hardware configuration and angle output.ServoSweephandles non-blocking back-and-forth movement.IAngleOutputdecouples motion logic from the physical servo implementation.IClockdecouples motion timing from Arduino's globalmillis()function.ServoConfigandSweepConfigkeep configuration explicit and easy to change.
main.cpp is responsible only for composing the components and coordinating setup() and loop(). This makes it possible to add a PCA9685 output or fake clock for testing without changing the sweep logic.
For detailed firmware documentation, see firmware/README.md.
| Parameter | Value |
|---|---|
| GPIO pin | 18 |
| PWM frequency | 50 Hz |
| Pulse width | 1000–2000 µs |
| Sweep range | 45°–135° |
| Step interval | 20 ms |
| Endpoint pause | 500 ms |
Build it with:
cd firmware
pio runIf pio is not in your PATH on Windows, use:
cd firmware
/c/Users/isaac/.platformio/penv/Scripts/pio.exe runatlas/
├── firmware/
│ ├── include/ # Firmware interfaces and component declarations
│ ├── src/
│ │ ├── main.cpp # Application composition and lifecycle
│ │ ├── servo_sweep.cpp # Non-blocking sweep behavior
│ │ ├── esp32_servo_output.cpp
│ │ └── arduino_clock.cpp
│ ├── README.md # Firmware architecture and build guide
│ ├── platformio.ini # PlatformIO configuration
│ ├── diagram.json # Wokwi simulation wiring
│ └── wokwi.toml # Wokwi configuration
├── cad/
├── LICENSE
└── README.md
- Basic ESP32 servo control
- Wokwi single-servo simulation
- Single-leg mechanical prototype in PLA + SG90
- Inverse kinematics for one leg, 3 DOF
- Range-of-motion validation
- PCA9685 integration
- Design and print all 6 legs
- Full chassis assembly
- Gait implementation: tripod and wave
- Migration to MG996R and ASA printed parts
- Stability and power-consumption tuning
AGPL-3.0 license. See LICENSE.