ESP32 Small Robot Dog

14,501

238

35

Introduction: ESP32 Small Robot Dog

ESP32 small robot dog is my attempt to make quadruped dog that become very popular after Boston Dynamics Spot. Work on the project still in progress and hardware and software can changed.

Features

  • Only ESP32 required (you don't need additional PWM i2c, Bluetooth modules, etc)
  • Arduino IDE
  • Web based interface with telemetry, to control robot you will need just you smartphone or tablet
  • CLI interface for calibration and debug
  • True Inverse kinematics code
  • Configurable Gait sequence and settings (just if you need it)
  • Fun

Electronics

  • 1 x ESP32 with 38pin
  • 1 x 50x70 mm green prototyping board
  • 12 x TowerPro MG90D or MD90S (cable should be out at the bottom of servo, thanks to triawan) servos (it can be tricky to use other servos, as size may vary, please have a look at this images of three different mg90-like servos: https://www.instagram.com/p/COoIyvzrLZt/)
  • 1 x INA219 (optional)
  • 1 x MPU9250 (optional, still has not been implemented, WIP)
  • 3 x Mini360 (DC-DC Buck Converter Step Down Module) or similar, 2 for front/hind legs (or more), 1 for ESP32
  • 1 x 18650 Battery Holder for 2 elements (try to find "18650 battery holder smt")
  • 2 x 18650 Battery
  • some capacitors

Other parts

  • 8 x 8x12x2.5mm bearings
  • 4 x small cable ties
  • Super glue (cyanoacrylate) to glue all parts together

Step 1: Print Parts

All STLs to print can be downloaded from Thingiverse page: Robot dog, quadruped robot, 12DOF, 3DOF per leg

Some part should be mirrored to be able to print correctly. Please see attached images.

My printer have issue with first layer thickness, aka Elephant Foot. Gears should be printed as perfect as possible, so I add very tiny spacer to avoid issue, you will see that some part "flying" over surface, so please enable support for it.

I'm strongly recommend print parts with best possible quality, especially gears. As also use brim and ironing.

Full list of parts to print:

Printable parts:

  • 1 x Body
  • 2 x Leg top
  • 2 x Leg top (mirrored)
  • 2 x Leg bottom
  • 2 x Leg bottom (mirrored)
  • 4 x Shoulder part1
  • 4 x Shoulder part2
  • 2 x Legs holder part1
  • 2 x Legs holder part2
  • 4 x Servo gear
  • 4 x Leg shoes, print with flexible filament (not required)
  • 1 x Cover
  • 2 x Cover clamps

Printable helping tools (see description on GitHub):

  1. 1 x CALIBRATION_LEG-Beta_and_Gamma
  2. 1 x CALIBRATION_LEG-Beta_and_Gamma (mirrored)
  3. 1 x CALIBRATION_LEG-Alpha
  4. 1 x CALIBRATION_SERVO-10deg

I'm using Ender 3 Pro, Cura, use Support and choose Dynamic quality. Plastic is PLA from OPY (AliExpress). For more details please visit Thingiverse page: https://www.thingiverse.com/thing:4822059

Step 2: Let's Make It Better and Glue Together

Preparation

Before we start, please check that bearings can be easy fit to body parts and over shoulder parts.

Also check that holes in Shoulder and body parts printed fine and servo cables (temporary disassemble servo connector) can be fit inside.

Do it

I tried to make body as light as possible, as small servos not very powerful. That is why you will need to glue some parts together. Promise it is not so hard =)

Make sure that gluing surfaces are flat, use some flat mini file and make sure parts can be connected to each other without space between. Then glue it together as shown on images.

Servo gears

Cut servo horn (see image) to fit it inside servo gear part and glue it together.

Step 3: Legs

Glue short servo horns into "leg top" parts.

Insert servo into "leg bottom part" and insert cable as shown on image.

Pull another servo cable through one of the hole on the "shoulder" part.

Repeat with other legs.

Step 4: Assemble Body and Legs Together

As was shown on previous pictures, pull all cables through legs and body holes.

Set all servos to middle using Arduino/ESP32 or servo tester.

Cut servo horn to make it fit inside "servo gear", glue it and install on the servo as usual. Insert servos into body. Screwing it can be challenging.

Squeeze "shoulder" part without servo (but with cable in place) and insert it between bearings.

Repeat with other servos and parts.

You don't need to fix legs with bolts at that moment, later you will need to calibrate legs following instruction in my GitHub repository: https://github.com/SovGVD/esp32-robot-dog-code

Step 5: PCB

PCB configuration is up to you. I can only show what I did.

Sensors connected to default I2C bus of ESP32 (GPIO 21 and 22).

Servos connected to:

  • Left front: 25 (body servo, servo gear, alpha), 26 (body to leg servo, shoulder, beta), 27 (leg servo,gamma)
  • Right front: 16, 18, 17
  • Left hind (back): 13, 12, 14
  • Right hind (back): 4, 2, 15

You can reconfigure it in the code, but make sure that ESP32 ISR Servo library support it.

Step 6: Code

Setup Arduino IDE to work with ESP32

Install addition libraries (most of them could be installed in Arduino IDE "Sketch" menu -> "Include Library" -> "Manage Libraries..."):

Setup WiFi Access point credentials.

  1. Rename config_wifi.example.h to config_wifi.h
  2. Change APssid to any name of your robot, e.g. SmallRobotDog
  3. Change APpass to password (8 or more chars), e.g. MySup3rPassw0rd
  4. After code upload to ESP32 you should be able to find SmallRobotDog WiFi with your phone or tablet.

Open browser and input URL http://192.168.4.1/ and you will see two virtual joystick to control robot dog.

Step 7: Good Luck!

Hope you like that project. More code and instruction updates on the go and hopefully will be release soon.

Be the First to Share

    Recommendations

    • 3D Printed Student Design Challenge

      3D Printed Student Design Challenge
    • Micro:bit Contest

      Micro:bit Contest
    • Retro Tech Challenge

      Retro Tech Challenge

    35 Comments

    0
    Gleb Devyatkin
    Gleb Devyatkin

    Reply 4 weeks ago

    Yes, that two, sorry for delay with reply. I add links to libraries.

    0
    omercancakaloz
    omercancakaloz

    Question 5 weeks ago on Step 7

    Hi! i finished making the robot, but I'm stuck in the codeing can you help me?
    I changed the name of config_wifi.example.h to config_wifi.h , i dont have problem with this part but it says "ESPAsyncWebServer.h: No such file or directory" how can i solve this problem?(Im opening code with this robot_dog_esp32.ino )

    Ekran Resmi 2021-09-12 10.21.26.png
    0
    Gleb Devyatkin
    Gleb Devyatkin

    Answer 4 weeks ago

    Hi, you will need to install following libraries:
    - ESP Async Web Server
    - ESP32 ISR Servo
    - MPU9250_WE
    - INA219_WE

    In the 'Sketch' menu -> Include Library -> Manage Libraries...

    0
    moesmourik
    moesmourik

    Question 3 months ago on Step 6

    good day and thanks for the share
    new to Arduino and asking witch file to upload to the esp
    thanks

    0
    Gleb Devyatkin
    Gleb Devyatkin

    Answer 3 months ago

    Hi! Sorry for late reply. First of all you will need to follow that manual to setup ESP environment for Arduino IDE. Then you will need to download code from https://github.com/SovGVD/esp32-robot-dog-code (click on the Code button and Download ZIP) and open software/robot_dog_esp32/robot_dog_esp32.ino file in Arduino IDE, all other files will be opened automatically. Follow other steps related to WiFi setting from Step 6. After that steps you will be able to upload code to ESP32. Good luck!

    0
    fctromba
    fctromba

    4 months ago

    how did you connect the inner servos to the gears? i dont see that in your instructions. Please assist. Thank you

    0
    Gleb Devyatkin
    Gleb Devyatkin

    Reply 4 months ago

    Updated. You need to cut one of the servo horns to make it fit inside printed gear. Use glue.

    0
    fctromba
    fctromba

    Reply 4 months ago

    Thanks thats what I thought but just wanted to be certain.

    0
    cjanner
    cjanner

    Question 5 months ago

    I have a problem compiling the code.
    It raises this error: "robot_dog_esp32:17:31: fatal error: web/index.html.gz.h: No such file or directory" and I dont have any idea where to get that file.

    0
    cjanner
    cjanner

    Reply 5 months ago

    Yes, I tried that. But for some reasons it did not compile.
    As I'm not really into Javascript could you please provide a compiled version.

    0
    cjanner
    cjanner

    Reply 5 months ago

    Awesome. Compiled at the first try. :)
    Thanks.

    0
    Gleb Devyatkin
    Gleb Devyatkin

    Reply 5 months ago

    Great! Have fun =)

    0
    cjanner
    cjanner

    5 months ago

    Am I missing the PCB layout? Please post it too or a link on how to put all the electronics togeter.

    0
    Gleb Devyatkin
    Gleb Devyatkin

    Reply 5 months ago

    In step 5 you can find scheme of connection for most of parts, as also list of pins for servos. It is not properly made PCB, just connections.

    0
    cjanner
    cjanner

    Reply 5 months ago

    What is the spec for the capacitor and what is it for?