BlueBoy
BlueBoy
Tuesday, October 11, 2022
I've wanted to build a balancing robot for many years and 5-6 years ago bought a couple kits that proposed to do just that.   They did not work very well.  Both had used normal DC motors, and the code was over-simplified.  All balance bots require PID (proportional, integral and derivative) control algorithms to operate properly.

I started research and found a great looking bot that was unlike the others.  Most balancing bots are short and low to the ground, but I found one that was about 2-1/2 feet (75 cm) tall called Red. He ran amazingly smooth, a testimony to very good code, and was more "human-like" than the others.

Red used a PS/2 controller and regular DC motors, but I decided to make BlueBoy taller, with stepper motors, and whatever controller was most useful at the time.

I changed my mind about 20 times regarding MCU processor to use since I had  a good stock of them to choose from: UNO, Nano, Due, Mega, ProMini, Teensy, ESP32, ESP8266.  My choice depended on the code I could find to get me started.


Possible MCUs to use
Tuesday, October 11, 2022
Arduino UNO, Nano, Due, Mega, ProMini, UNO-wifi2, Leonardo
PJRC Teensy3.2 or Teensy4.0
Exprissif ESP32 or ESP8266

TESTED: UNO, Nano, Due, Mega, Leonardo, UNO-wifi2

USED: UNO and Nano

Possible remote controls to use
Tuesday, October 11, 2022
PS/2
Arduino joystick (for Mega or UNO)
Custom joystick
Wii Nunchuk
Old TV remote control (IR)
Android or Apple App for tablet or iPad (I don't have a phone).

TESTED: all of them

USED: Nunchuk

Possible communication devices
Tuesday, October 11, 2022
Bluetooth HC-05
433 MHz RF
HC-12 transceivers
wifi (various)
nRF24L01 2.4GHz RF

TESTED: all of them

USED: HC-12 transceivers

Items must use
Tuesday, October 11, 2022
MPU6050 gyroscope/accelerometer
Nema 23 Stepper motors
Lithium batteries
TB6600 stepper motor drivers
Arduino IDE





Copyright 2022 Queenidog - All Rights Reserved
Printed Circuit Board
Wednesday, October 12, 2022
After breadboarding and testing all parts of the circuit, I made a PCB that fit onto an UNO development board.  There are two versions: V1.0 and V2.0, the latter due to stepper motor driver changes.  Both are shown below, with schematics.
Why BlueBoy?
With apologies to Gainsborough who painted the "original" Blueboy, I named my bot, because...well, he's blue!  I based his shape and color on a balance bot named Red.  (Click photo below to see video)
Red

V1.0 using A4988 Stepper motor drivers

V2.0 using TB6600 Stepper motor drivers

Basic construction

V1.0 photos (click)
After a few months of work with revisions along the way, I realized that using timing belts to drive wheels 18" away was NOT going to work.  There was too much "play" in the entire drive system, except for the stepper motor - it was steady as a rock of course.  This would not work well with the control code that has to compensate for any movement.

So...  I had to bite the bullet and remove all this offset and drive the wheels directly .  I then suspected I would need more power and my little Nema 17 motors would not do the trick, so I upgraded to a set of Nema 23 motors with impressive torque numbers: 269 oz-in or 1.9Nm.

More motor power requires increased current and my small A4988 drivers would not fit the bill (they are rated for 2 amps, I need 4 amps minimum).  I had to replace them with two larger controllers I had purchased for another project.  The signal connections were also different so my UNO PCB shield was not going to work.  I could have jerry-rigged the  board, but this is not good for reliability, so I made another one.

My first attempts at all this are on the page: BlueBoy V1.0.   This page is V2.0.

These are the changes: (V2.0 on left, V1.0 on right):  (hover for description)
Software
(Click to link)