Whenever I think of Robotics a Hexapod is the first thing that comes to mind. After a long time of planning I am now ready to share my design.
The most important parts of my design are listed bellow:
- Cheap: 120 € (see Parts (toBuy) file)
- RGB: 271 individual RGB LEDs for you to mess with
- Cable management: Cables are routed inside the leg. No cable loops that can get tangled
- ORP compatible: compatible with the Open Robotic Platform modules
- Bluetooth control: Remote control via phone app
This build is definitely not an easy one. But once complete it is very rewarding.
You can find everything you need on GitHub. Including 3D models, code, parts list, schematic and more.
Step 1: Watch the Build VideosStep 2: PrintingEverything is oriented the right way and supports have been added where necessary. Everything has been designed in a way to minimize supports as much as possible.
Print everything once except for the leg_set and leg_set_mirrored which you will need to print 3 times each.
Some of the body parts take up the entire build area so you will need a well levelled build plate, or even better mesh bed levelling. I don’t have that but it still worked out fine.
For the bushing_set you will need to try out different values for the XY Compensation. These bushings need to add some resistance to each joint to reduce chatter.
I printed with three shells and 10% infill.
Step 3: AssemblyOnce you have all the parts you can start building the legs and body. I don't have detailed build instructions for either but you can watch the build compilation of my two videos and take a look at the assembled 3d model.
I would highly recommend to first build a single leg to get some practice but also to find the right values for the bushings. If they are too loose the leg will have a lot of chatter. If they are too tight the leg won't move at all. In general the more mass a servo is moving the more resistance it needs.
Also make sure to zero each servo before building the leg. While building make sure that each joint forms a 90° angle. The curvature of the leg makes this a lot more annoying.
This is required to ensure the IK system for each leg works. If this is even slightly off, and it will be, you will have to try different offset values (in the “output.cpp”) to dial this in for each leg.
Step 4: WiringConnect everything like in the wiring diagram above. Be sure to use shielded wire for the connection between the STM32 and the servo drivers. I had some problems with interference without it.
The LEDs are all connected in series in this order: Eye Centre, Eye middle ring, Eye outer ring, bottom ring, leg[ (front right) root -> tip (proceeding clockwise)
For the servos you can connect them to wherever is easiest. However you will need to set the channel for each servo in the "output.cpp" file correctly.
On that node ensure that you bridge the first solder pad on one of the servo drivers. This will ensure that it uses a different I2C address. This second driver will continue the channel numbering of the first (16-31).
Step 5: ProgrammingThe code has been written in Visual Studio Code with the platform IO extension.
To Upload it make sure you have both installed and add the folder bellow as a project.
From here upload the code. Be sure to use an ST-Link for this. You can use a simple FTDI Programmer or something similar but you will have to unplug the Bluetooth module to connect it and change the "upload_protocol" in the platformio.ini file from "stlink" to what your programmer requires. Check here for more info.
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
debug_tool = stlink
upload_protocol = stlink
lib_deps =
adafruit/Adafruit PWM Servo Driver Library@^2.4.1
fastled/FastLED@^3.6.0
If you want to deactivate some functions, for example the LEDs, for some reason you can do that in the "header.h" file by commenting out what you don’t want. This can be great for testing new features.
#define WS2812B_LED
#define SERVO
#define DEBUG
// #define DEBUG_SERIAL
#define DEBUG_LED
#define BLUETOOTH
Step 6: Install Remote AppInstall the application bellow. You will get a message saying this might be dangerous to install. This is normal so don't worry. If you don't trust me take a look at the MIT App Inventor project files on GitHub and compile it yourself.
Once installed make sure to allow "Nearby Devices". This is required for the app to find available Bluetooth devices.
Note that there are slider for controlling the Hexapods LEDs but that is currently disabled to reduce latency.
Step 7: Connect to HexapodThe only thing left to do is connect to the Hexapod.
Turn your Hexapod on and pair to the Bluetooth module in you phones Bluetooth settings (only do this once). The default password is 1234 or 0000.
Once this is done open the Hexapod Remote app and connect to the Bluetooth module.
Once connected the Hexapod will have a simple startup animation and now you can control the hexapod using the two sticks, kind of like a drone.
Step 8: Admire Your WorkSeeing the project work is the most rewarding thing for me. I know most people won't build something as complex as this but I still hope I was able to inspire you to build your own robotic Projects.
If you have any questions, feel free to write me a comment.
Happy making :)
Comments