I have never built a hardware project before and I wanted to try something new. To really learn hardware, I decided to dive in the deep end by building a robot from scratch.

I didn't know that building a robot would be this challenging. Because of my inexperience and the scope of the project, I only got 4 hours of sleep the entire weekend! I had to work constantly to assemble the electronics, code, and hardware myself.

What it does

The robot processes accelerometer data and balances on two wheels. This is MUCH more difficult than it sounds.

How I built it

Every part of the assembly is 3D modeled by me in Onshape CAD software. I had to wire and assemble the IC's together, and design algorithms that parsed accelerometer data and translated it (with very complicated math!) to roll, pitch, and yaw values. These values would then go through a PID algorithm to output motor speeds such that the robot can stay balanced on two wheels.

I had to go to a hardware store to buy the screws and bolts. Aside from this hardware, I modeled and printed every part.

Two of my parts wouldn't mold together 2 hours before the deadline. I had to run to home depot and walmart looking for good super glue and rush back quickly to finish.

Challenges I ran into

No matter how precise your CAD measurements are, the 3D printer's variability causes the models to print incorrectly. I had to print over 4 different version of each part until I nailed the exact measurements that make the parts fit. All this iteration meant staying up and printing all night, both nights.

Accelerometers only return acceleration values, so calculating for position change is a very difficult math problem. I had to read up on Madgwick quaternion filter source code to solve this.

There is also a lot of unexpected friction between the bushings and the gears. This causes the robot to stall often.

Accomplishments that I'm proud of

I've never built a hardware hack before! It was a ridiculous amount of fun. I want to become a mechanical engineer now o_o

What I learned

Everything! Electronics, c++, 3D printing, modeling. I have never done hardware before and I wanted to learn electronics and 3D modeling.

What's next for 3D Printed Balancing Robot

Bluetooth remote control. Download an app to drive the robot around.

Built With

Share this project: