YAP - YABR (Yet Another Balancing Robot)


#1

Welcome to another YAP (Yet Another Project)
This time it’s a self balancing robot…
I was researching STM32 stuff (blame @Jarrett) and stumbled onto an interesting site…

http://www.brokking.net/yabr_main.html

While not STM32 based the balancing robot caught my interest mainly cuz I had a bunch of the needed parts gathering dust… So I decided to build one and figured I’d document the process here.

The one thing I did not have was the wheels. In the project he is using laser cut plywood to make them but I sort of wanted something better. I spent a lot of time searching AliExpress. I wanted a similar size (2ish inches) but with decent rubber… I also had to find something that would easily mount on the 5mm stepper shafts. While not really as cheap as I’d like I found these and ordered a set:
https://www.aliexpress.com/item/DC-motor-tire-wheel-coupling-combination-of-intelligent-robots-DIY-model-toy-car-accessories-aperture-3MM/1966875941.html

Since I had to wait for the wheels I went about gathering the parts I did have and figuring out what size board I would need.

Looks like a 7cm x 9cm proto will do the trick and luckily I had one.

One thing I was missing was the radio transceiver module. Looked around and ordered a couple of these as I had seen them used in some other projects:
https://www.aliexpress.com/store/product/1pcs-433Mhz-HC-12-SI4463-Wireless-Serial-Port-Module-1000m-Replace-Bluetooth-NEW/731260_32695273537.html

Next I thought about the frame. They used plywood for the prototype but I didn’t have any thin stuff to use. But I do have lots of aluminum angle so I decided to use it. I’m wondering if it will affect the rf signal but it will just be a frame so there will be lots of open area.


#2

Normally I would use a NANO for something like this but the PRO-MINI is even smaller (cuz it doesn’t have the USB/Serial chip onboard) and since I had one I decide to go with it as the NANO was a bit too large. The caveat is that you need a USB/Serial adapter to program but the programming pins can stick straight from the board allowing and easier connection…
And the CH340 USB/Serial board are really cheap…
And I shouldn’t have to make many programming changes…


#3

I decided to use a drawing program to figure out the best sizes for the aluminum. I figured better measure twice and cut once (though typically I do the complete opposite…

I’m going to use 1/16" x 1" angle. Tomorrow I will cut it to size and drill out the holes to mount the steppers. I’ll probably just pop rivet the pieces together to make the frame.


#4

Here is the stepper motor(s) I’m going to use:

It’s a NEMA17 instead of the smaller NEMA14 used in the prototype but they should work…
Mebbe I’ll need a bigger battery…


#5

So I cut up some aluminum angle

Used a square to align and drilled some holes:

Notched out where I want to mount the steppers:

Finished it up with a file:

Put it together with pop rivets:

And the final product:


#6

I got the wheels today and am pretty happy with them


They come with a heavy duty adapter to mount on the 5mm stepper shaft with 2 set screws

The wheel then mounts over the adapter and locks in with a screw and lock washer

They are a bit larger diameter (2.5" rather than 2") than used in prototype but it should not be an issue…
I don’t think…


#7

Mounted the PCB on the frame and attached the motors…

Next on to wiring up the circuit board… While normally I’d use sockets for the various modules I think I’ll solder them in place to keep a low profile (the sockets add 5/16" to the height)…

And hope I don’t need to replace any of them…


#8

Very nice progress reports!

Hey, is that a TTY in the background?


#9

Yup… Found it in the trash… Seems to work…


#10

Still waiting on the serial transceivers from AliExpress but have started on the wiring of the control board…

Ended up using a Nano as the Mini has the I2C pins in a funny spot that doesn’t work with the pins and perf board…

Trying to keep the motor power wiring seperate from the logic stuff…
I’m using some 22 gauge tinned bare solid wire for the main power connections…
Using heat shrink over some of it to prevent shorts…
Probably should get some red to be able to easily tell what is GND and whats is V+…
The terminal strip gives seperate connections for the battery and a power switch that I will mount on the frame…


#11

Soldered up the rest of the board except for the serial transceiver. Added some extra filtering caps for good measure:

I’m using an set of HC-12 modules for the radio connection:


They are 433 Mhz with adjustable power and radio channel…
No frequency hopping or encryption but this is just a simple remote…

Here is the backside…

I like this method of building prototypes. I have tried veroboard (strip board) but find this easier. You end up something approximating what a PCB would look like. This of course, assumes you spend time laying out everything and account for every part, which I never seem to pull off).

I tend to follow these steps:

  1. Lay out parts in pleasing manner to fit board space.
  2. Tack solder parts in place.
  3. Run ground and power lines. I tend to use #22 solid wire for this. I use heat shrink tubing to protect from shorts as required.
  4. Test all connections. Important to do this as you progress as fixing issues once you have a mess of wiring done is very difficult.
  5. Run data and signal lines. I use #28 (or mebbe it’s #30) insulated wire wrap wire for this.
  6. Again test as much as you can in stages to avoid having to access connection buried under later work.

Ideally you should use black and red heat shrink tube to denote GND and V+
Ideally you should use different colors of wire wrap wire for the signal runs.
I use what I have…

There used to be a “wiring pencil” product by VERO that used a similar wire (perhaps even thinner) that you would wrap around a pin and then solder as needed. The wire was insulated but would burn off with the heat of the iron to allow soldering.

They don’t seem to make such a thing anymore but I did find this product:
https://canada.newark.com/roadrunner/rrp-103/wiring-pencil/dp/07WX0910
Only Newark seems to stock in in Canada so may try a order from them next time…