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 needed:
- Servo Motor 20kg x 12 link
- Servo Driver PCA9685 x 1 link
- Power Switch x 1 link
- Raspberry Pi 4b x 1 link
- Step Down Converter x 1 link
- Step Down Converter 2 x 1 link
- LiPo Battery 2200 mAh x 1 link
- 25T Aluminum Servo Arm x 12 link
- Servo Extension Cable x 6 link
- Cable ties link
- M2, M3, M4 Screws
- Jumper wires
- 1.5 mm wires
- USB-C cable
Components for wireless communication:
Leg Design
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
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
For extra traction, I have glued some rubber to the end of the lower leg and secured it with zip tie.
Wiring
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
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
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
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.