PIDDYBOT - DIY Arduino Balancing Robot

14,483

199

22

Introduction: PIDDYBOT - DIY Arduino Balancing Robot

About: I'm a content creator. I make open source projects and videos for said projects. My goal is to create free and open knowledge for everyone.

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!

Parts:

Tools:

Step 3: 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)

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

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)

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)

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

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

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!

Step 11: 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.

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

Step 13: 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

GIFs Challenge 2017

Runner Up in the
GIFs Challenge 2017

Teachers Contest 2017

Participated in the
Teachers Contest 2017

Be the First to Share

    Recommendations

    • Mason Jar Speed Challenge

      Mason Jar Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    22 Discussions

    0
    NikhilG47
    NikhilG47

    Question 2 years ago on Step 3

    is there a schematic file for the circuit board

    0
    ddm9599
    ddm9599

    3 years ago

    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?

    0
    NareshL33
    NareshL33

    3 years ago

    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

    0
    Ralphxyz
    Ralphxyz

    3 years ago

    Download link not working!!

    difnitely want this, thanks for posting.

    Ralph

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

    Oh no! - Which link?

    0
    Ralphxyz
    Ralphxyz

    Reply 3 years ago

    The Download link!!

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

    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?

    0
    Ralphxyz
    Ralphxyz

    Reply 3 years ago

    It was the top downloads link on the Instructable page.

    It is working now!!

    Ralph

    0
    Ralphxyz
    Ralphxyz

    3 years ago

    PCBWAY sales is really stupid, unable to order PCB.

    0
    seamster
    seamster

    3 years ago

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

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

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

    0
    Kevin_Minckler
    Kevin_Minckler

    3 years ago

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

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

    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.

    0
    jpnofear
    jpnofear

    Reply 3 years ago

    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

    0
    travis_marsh
    travis_marsh

    3 years ago

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

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

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

    0
    ajayt7
    ajayt7

    3 years ago

    Wonderful, enlightening project and some presentation! Awesome

    0
    seanhodgins
    seanhodgins

    Reply 3 years ago

    Thanks!

    0
    IgorF2
    IgorF2

    3 years ago

    Awesome!

    0
    Poods1992
    Poods1992

    3 years ago

    Can I use this to log the sensor values?

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