Introduction: PIDDYBOT - DIY Arduino Balancing Robot

Picture of PIDDYBOT - DIY Arduino Balancing Robot

The PIDDYBOT is a small Open Source balancing robot with the aim of teaching PID controls using a "hands on" concept. Anyone can play with the PIDDYBOT and start to develop an understanding of what the P, I, and D terms within the PID loop do, even if that person has no concept of the math behind the control itself. It is a great teaching tool for the classroom. The program I have written for the PIDDYBOT uses the potentiometers to physically control the PID terms. This way you can turn them in real time and see the effect they have on the control parameters. The PIDDYBOT can also be programmed with more complex programs as well. There are encoders for the wheels to add more stability, and if you like you can add Bluetooth for remote monitoring.

Check out the video below for more info.

Step 1: What Is the PIDDYBOT? - Check Out the Video!

Step 2: Get the Parts and Tools!

Picture of Get the Parts and Tools!

Parts:

Tools:

Step 3: Main PCB First(Surface Mount Soldering)

Picture of Main PCB First(Surface Mount Soldering)

I like to start out by soldering the main board. Same as always, I do the smallest stuff first, resistors and caps, and the ICs and package components last.

You know the drill.

Do not populate F1 or D6. They're not in the BOM anyway.

Step 4: Main PCB Soldering (Through Hole)

Picture of Main PCB Soldering (Through Hole)

After the board has been reflowed in the oven, or maybe soldered by hand(I used to do it this way!) - time to solder on the through hole components, battery connector, switch, and pots.

Step 5: Program Custom Bootloader and Test

Picture of Program Custom Bootloader and Test

Now that the main board is together, lets throw a bootloader on it and see if it works. The PIDDYBOT needs a custom bootloader, which can be found here, or in the GitHub Repo.

The file is called Caterina-PIDDYBOT.hex - I use Atmel Studio 7 and an AVR ISP MKII to put it on. There are a ton of tutorials on installing a bootloader on an Arduino. You can actually just use another Arduino to do it also, don't need a fancy ISP programmer. Slightly more info in the video.

Step 6: Solder Custom Encoders(Optional)

Picture of Solder Custom Encoders(Optional)

In order to send power to the motors, I have designed a smaller board which you can order as well. It also allows the use of the magnetic encoders on the wheels. The program as of yet does not utilize them(maybe in the future) but you might as well install them now, because I'm sure you will be improving the program the second you build the PIDDYBOT.

If you don't want to install these you can just connect the motors to the motor outputs on the PIDDYBOT.

Step 7: Install Encoders on Motor(Optional)

Picture of Install Encoders on Motor(Optional)

If you are installing the encoders, I find the easiest way to install them is to make a hole in a cardboard box and put the shaft of the motor through it to hold them vertical. Luckily I had my PCBway box handy.

Step 8: Assemble PIDDYBOT

Picture of Assemble PIDDYBOT

Install the motors in the bottom with the M1.6 3mm screws and secure the PCB to the body with some plastic threading screws(or anything really, even an elastic band) the more secure the better. The PIDDYBOT might come apart in some violent balancing efforts if its not overly secure.

Step 9: Program PIDDYBOT With Arduino IDE

Picture of Program PIDDYBOT With Arduino IDE

Now you can program the PIDDYBOT using the program I have supplied. Its available here, and on the GitHub Page.

Its pretty rough, but it will get him balancing! The atmega32U4 can be finicky when programming, and seem like its not working. It sometimes takes a carefully timed reset when programming.

Step 10: Look What You Have Made!

Picture of Look What You Have Made!

Step 11: Play and Learn!

Picture of Play and Learn!

I mention this in the video but I will write it down here.

When you first get the PIDDYBOT working, steps to starting it.

  1. Turn all POTs counter-clockwise (to zero)
  2. Turn on PIDDYBOT
  3. Immediately hit RESET so bottom LEDs turn off(Weird bootloader thing)

To start balancing, place PIDDYBOT on surface, and try and find the 0 angle position(standing straight up) with your hands, keep him there as you turn the P term up, he will begin trying to balance, you have now set the zero position. If it seems off, set all the POTs back to zero and try again.

Step 12: Not Quite the Robot Army Apocalypse.

Picture of Not Quite the Robot Army Apocalypse.

These robots won't quite be taking over the world any time soon.

Step 13: Support My Projects!

Picture of Support My Projects!

If you would like to support my projects, Consider becoming a patron, subbing to my YouTube and following on Instagram. I would love to be able to rely on the support of my viewers, so I can keep creating free open source projects like this one.

YouTube SeanHodgins

Patreon Sean Hodgins

Instagram

Twitter.

Get notified the moment a new project comes out!

You can also send me bitcoins, here - 19s7hAVkm54Ev7QZEsWAfoyECy1CwXSrhL

Comments

ddm9599 (author)2017-09-26

Awesome project! I'm looking to do my own spin on this as a side project. Any chance you've updated the Kicad project on Github?

NareshL33 (author)2017-09-22

The name, PID, DY BOT, is just too cool. Having been brought up on PTH PCB's the SM components are now too hard for me at 67. Is it possible a commercial souce will produce the PCB (and perhaps pre-programmed too)? I can assemble the rest of the mechanical bit and pieces! Also manage some soldreing with my Iroda Solder Pro 50 gas soldering iron. Thanks!, Naresh

Ralphxyz (author)2017-09-21

Download link not working!!

difnitely want this, thanks for posting.

Ralph

seanhodgins (author)Ralphxyz2017-09-21

Oh no! - Which link?

Ralphxyz (author)seanhodgins2017-09-21

The Download link!!

seanhodgins (author)Ralphxyz2017-09-21

There are multiple download links, and download links on GitHub, and download links on some other sites. They all work for me, so please specifiy, which link is not working for you?

Ralphxyz (author)seanhodgins2017-09-21

It was the top downloads link on the Instructable page.

It is working now!!

Ralph

Ralphxyz (author)2017-09-21

PCBWAY sales is really stupid, unable to order PCB.

seamster (author)2017-09-20

Ha, I love the gif in step 12! That's awesome. Nice work Sean!

seanhodgins (author)seamster2017-09-21

It took a lot of work to get that shot! :) Thanks!

Kevin_Minckler (author)2017-09-21

Am I'm missing something? Where is the schematic for the project and the gerber files to create the PCB?

You're right, the schematics did go missing. However the Gerbs and the BRD file(for Eagle) can be found in the GitHub: https://github.com/IdleHandsProject/thePIDDYBOT - The BRD file still works even though the schem is missing. I'm working on recreating it, since it was lost. You have reminded me, I need to include a BOM. I have added one to the GitHub, which can be used to place the components.

jpnofear (author)Kevin_Minckler2017-09-21

This is a link to his shared files at pcbway you can download or order from there https://www.pcbway.com/project/member/shareproject/?bmbid=11751

RO Mechanic (author)2017-09-21

I appreciate your simple way to describe the PID-DY-BOT as a PID algorithm application! Thank you for sharing your project.

seanhodgins (author)RO Mechanic2017-09-21

You're welcome. I hope it inspires other to make their own teaching tools!

travis_marsh (author)2017-09-21

This is super awesome. Loved the way you use GIFs throughout this DIY project.

seanhodgins (author)travis_marsh2017-09-21

Thank you. I believe the extra work to make the GIFs makes it worth it in presentation. Glad you agree.

ajayt7 (author)2017-09-21

Wonderful, enlightening project and some presentation! Awesome

seanhodgins (author)ajayt72017-09-21

Thanks!

IgorF2 (author)2017-09-21

Awesome!

Poods1992 (author)2017-09-20

Can I use this to log the sensor values?

https://www.instructables.com/id/Google-Sheets-for-IOT/

vishnumaiea (author)2017-09-20

Awesome! <3

R_Kumar (author)2017-09-18

Just WOW!

About This Instructable

11,619views

182favorites

License:

Bio: M.a.Sc in Mechanical Engineering. Pretty much designing a new circuit board every day, and I have made a few inventions of my own ... More »
More by seanhodgins:YouTube Christmas OrnamentArduino Neural Network Robot3D Printed Pumpkin Bokeh Cover
Add instructable to: