3D Printed Robot Dog

by Mirjakhon in Circuits > Raspberry Pi

7871 Views, 136 Favorites, 0 Comments

3D Printed Robot Dog

Front_pic.jpg
3D printed Robot dog

In this project, I made a robot dog like Boston Dynamics' Spot, but of course a much simpler and cheaper version. It can walk, turn and do different poses, and it is controlled remotely and powered by Raspberry Pi 4b.

In contrast to other robot dogs available online, this one has a straightforward design, a more affordable price tag, and very simple code, making it easily customizable even if you have limited programming experience.

If you have any questions regarding the project, do not hesitate to reach out to me!

I named it Nova!

Supplies

Components_all.png

Components needed:

  1. Servo Motor 20kg x 12 link
  2. Servo Driver PCA9685 x 1 link
  3. Power Switch x 1 link
  4. Raspberry Pi 4b x 1 link
  5. Step Down Converter x 1 link
  6. Step Down Converter 2 x 1 link
  7. LiPo Battery 2200 mAh x 1 link
  8. 25T Aluminum Servo Arm x 12 link
  9. Servo Extension Cable x 6 link
  10. Cable ties link
  11. M2, M3, M4 Screws
  12. Jumper wires
  13. 1.5 mm wires
  14. USB-C cable


Components for wireless communication:

  1. Arduino UNO x 1 link
  2. Nrf24l01+ x 1 link
  3. Game pad shield for Arduino x 1 link

Leg Design

Leg1.png
Leg2.png
Leg3.png
Leg_movement_gif.gif
Whole_leg_gif.gif
photo_2023-11-26_19-34-54.jpg

The robot dog consists of 4 legs, each capable of movement in 3 different ways, utilizing 3 servo motors for each leg, thereby providing 3 degrees of freedom. Assembly is a straightforward process, and visual references are available in the provided pictures.

Note that some STL files are mirrored to ensure symmetry in the legs. For all parts except the servos, use M3 screws.

During assembly, follow the sequence of attaching hips first, then progressing to the thigh and lower leg. Attach the 25T servo horn to the 3D printed parts before fixing it onto the servo motor. Before assembly, ensure that each servo motor is set to a 90-degree angle and the joints are at 90-degree angle as shown in the picture.

In the event that the 25T servo horn does not fit into the servo horn cap, a useful trick involves heating up the 3D print by submerging it in hot water for a few seconds. This will make it more pliable and allow for a proper fit.

Lastly, I recommend to print parts with an 80% infill, particularly for the lower leg, as it undergoes significant stress.

Main Frame Design

frame_desing_gif.gif
Screenshot 2023-11-25 145641.png
Screenshot 2023-11-25 145711.png
Screenshot 2023-11-25 145924.png
Screenshot 2023-11-26 202557.png

To begin the assembly process, start with the main frame and the attachment of the legs. Once the main frame (main_frame) is printed, secure the frame_leg_links in the manner shown in the provided GIF file. Use M3 screws to attach each leg to the frame. Frame cover will come on top of the main frame. This will hold the Raspberry Pi fixture.

The frame design is adjustable and looks like cheese to keep things modular, help with cable organization, and make it easy to tie down components with zip ties.

I also made a test stand if you want to change the code and test things out safely.

Extra Traction

photo_2023-11-26_20-31-38.jpg

For extra traction, I have glued some rubber to the end of the lower leg and secured it with zip tie.

Wiring

Wiring_diagram.png
Screenshot 2023-11-26 121207.png

After putting together the 3D printed parts and attaching the servos, it's time to handle the wiring. Place the LiPo battery in the center, as it's the heaviest component. Put the XL4016 DC-DC converter next to the battery and the Servo driver module on the opposite side. Use zip ties to secure them in place.


Now, take the power switch (Male XT60 plug) and cut off one end. Connect one side to the battery, and the other side goes to the input of both DC-DC converters (connect them in parallel). For this part, use thicker cables, around 1.5mm, due to the high current flow. The output of the XL4016 DC-DC converter should be connected to the servo driver module.

Important! Make sure both DC-DC converters are set to a 5V output because both the Raspberry Pi 4 and the servo driver module require exactly 5 Volts.


Connect all the servos to the servo module. Start with the front left leg, connect the hip servo to the first row ('0' row on the servo driver module), the thigh servo to the second row ('1' row), and the lower leg servo to the third row ('2' row). Repeat this process for the front right leg, back left leg, and finally the back right leg.

Use jumper cables for the I2C connection between the servo driver module and the Raspberry Pi.

Wireless Communication

Screenshot 2023-11-26 122530.png
Screenshot 2023-11-26 123730.png
Screenshot 2023-11-26 124851.png

In order to remotely control the robot dog, I used NRF24L01+ 2.4G Wireless Transceiver Modules. Connect one module to the Raspberry Pi using jumper wires and the other to the Arduino UNO equipped with the game pad shield as shown in the pictures.

Uploading the Code

photo_2023-11-26_13-16-51.jpg
Screenshot 2023-11-26 132633.png

For the programming part, begin by starting the Raspberry Pi and visiting my GitHub page (link). In the top right corner under "< > Code" download the .zip file. Unzip the file into your preferred folder and run the main.py file using any code editor.

Before running the code, you may need to download a couple of packages. Since the transceiver library is written in C++, integrating it with Python can be a bit tricky. I've discovered a helpful tutorial on YouTube that explains every step of the setup (link).

On the transmitter side, it's relatively straightforward. Download the Arduino program from my GitHub page (link) as a zip file and unzip it. Then, visit this link, to download the library for the module and save it in any folder (no need to unzip). Open the Arduino program using the Arduino IDE, include the library (zip file) as shown in the picture, upload the program to your board, and you're good to go!

Controls

Screenshot 2023-11-26 211156.png
ezgif.com-video-to-gif.gif

Now the controls:

The joystick is responsible for directing the robot's movement, controlling both forward and backward motion, as well as turning while in motion. Buttons A and C adjust the movement speed, with A increasing it and C decreasing it. On the other hand, buttons B and D manage the turning speed, with B increasing it and D decreasing it. Pressing the central button, E, will initiate a predefined pose for the robot. It only works if the robot is not moving.