Bruton’s clever geometric reorientation elegantly decouples rotational control, proving that spatial ingenuity can significantly simplify complex robotic stabilization. It is a brilliant demonstration of how fundamental trigonometry provides the most efficient solutions to sophisticated engineering hurdles.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Experiments with Ball-Balancing Robot Wheel Orientation
Added:I built a one ball balancing robot that I can ride on and it was pretty quick.
There were some issues with static electricity building up and causing it to cut out though, which I'm still trying to solve, but also steering was pretty difficult originally. I added some electric ducted fans to blow it around, which was quite successful. But in the last video, I also discussed various other methods of controlling yaw, which is the vertical rotation axis. I talked about reaction wheels and gyros, so check out the last video about that. But the simplest alternative method to blowing it around with fans seem to be just rotating the ball. At the moment, the three Omni wheels that drive the ball are aligned vertically, which gives a much higher velocity potential than most other ball balancing robots where the wheels are aligned vertically. In order to be able to have control over rotating the ball, it appears that all we need to do is turn one wheel around 90°. At the moment, only two wheels drive the bike sideways and three drive it back and forth. So rotating the back wheel would just mean that two wheels now drive it back and forth and then three wheels would drive it sideways, but we'd also have the ability to drive the ball around. I don't want to rebuild the whole thing.
So in this video, I'm going to be building a small version which runs on a standard basketball so we can see how it might work. The project is open source and all the CATN codes on GitHub if you want to have a go, but I also give enhanced downloads to patrons which include things like the wiring diagram and some written documentation. Patrons also get all the videos up to a week early with no ads in and it's only $1 a month. I want to make this project accessible to reproduce, so I'm designing my own omni wheels that can be 3D printed. And I've done these with four perimeters with a gyroid infill in Polymaker TPU 95. The gyroid infill makes them uniformly firm all the way around so they don't squash in one direction more than the others. There's also a bunch of standard PLA parts here.
All of these parts have been printed with a 0.4 mm nozzle on a 0.2 2 mm layer height on my fleet of Pruscha printers.
So, thanks to Pruscha Research for sending me all these 3D printers, which I couldn't get the projects done without. The rollers on my Omni wheels are TPU and they're running straight on a piece of 3mm stainless steel axle without any bearings or rigid core, but they run pretty well and they move pretty freely. So, the configuration is going to be these axles within the PLA parts and then wheels put on each one.
And hopefully you can just see there's a black nylon washer either side that stops that wheel rubbing on the side.
All of those are fitted on one half and then the other half fits on top and that clamps all of the axles in place. And of course some selftapping screws are screwed into the holes to hold it nice and firm. All my wheels still move quite freely. So that's pretty good and that's a good thing to test. On top of that, we've got a spacer that fits in there and then another layer that goes on top.
And that fits essentially the other way up so that the sets of wheels fill in the gaps on the other layer. On the end of that square axle is a little gear we're going to use to drive it. And that has a little place for some screws in each side or of course they could be glued on. And this makes a round profile wheel where the wheels are filling in the gaps on the other layer so it rolls smoothly. And of course it slides sideways on the little wheel. And that's why it's an omni wheel. And of course, there are three of those because we need three for the robot. Each one has a steel shaft push fitted in the middle.
And then we're going to put a washer on the outside of that on each side. And then after that, we're going to have a bearing. And that's what the actual wheels going to run on. So we can motoriize it with the little gear and it will run nice and freely. So even though these are TPU running on steel axles with no bearings or anything, they actually run really well and they grip this ball as well. really well because they are TPU and the ball is quite grippy as well. So, we're going to have no problems there with traction. So, all we need to do now is get all three of these and put them on the chassis to hold them in the right place. I found these geared motors which are from DF Robot and they have 131 to1 gearbox which is roughly 83 RPM at 12 VTs and they also have a quadriure encoder that we need to control the velocity. The motors have the same size gear on.
There's a captive nut and a grub screw to hold that onto the flat of the motor shaft. And that's going to run one to one onto the wheel. You can see we've got two wheels which are aligned vertically. So those are going to basically be the left and right wheel.
And then at the back we've got one wheel that's aligned horizontally to test this whole thing out. There is quite a bit of concerning backlash, but that's in the metal gearbox. My 3D printed gears are pretty tight, so we'll have to see how that works out. The brushless motors, generally with a belt, don't have any backlash. So let's power this up. We can see that we've got an okay amount of velocity, which may or may not be enough, but there seems to be enough torque to balance this. And it's quite important we have enough torque throughout the whole velocity range.
So, this sits on a standard basketball and everything should clear the ball, allowing the wheels to move it around with nothing dragging underneath. And of course, we do have these gear ratios that are currently 1 one. But basically, if we need more torque and a lower speed or we need higher velocity, we can just change the gear ratio without having to buy new motors, which is a really good tip. So, the next thing we need is some electronics to control it. I'm using the remote control from last time, and I'm using ESP32 with ESP now to get the data between the remote and the ESP32 in the robot. I've also got an inertial measurement unit which is the Adafruit BNO086 and I'm going to use that to measure the angle. This is exactly the same setup as the last project which you should check out if you haven't already. And that was a dynamically balancing bipedal robot with only five servos. So I'm using ESP now which is a very simple pointto-point wireless protocol to get data between ESP32s and that sends my joystick and button data. And I've also got the inertial measurement unit data so we can measure pitch and roll. And we're going to process that data for a controller to make the robot stable. And you should check out random nerd tutorials for information on ESP. Now, it's a very simple wireless protocol where you can send data from one ESP32 to another straight to a MAC address. It's Wi-Fi, but there's no access points or any IP addressing involved. My receiving ESP32 is in the robot. There's a number of wires attached. The blue wires are for driving the motors, but that has to go via these motor drivers, which are IBT4s, and that's going to carry the current to actually power the motors. As well as the motor power, which is currently not attached, there are four more wires in the motor connector, which are zero and 3.3, and the two quadra encoder wires, which are the two orange wires, and we're going to use that to control the velocity. Those orange wires are connected to interrupt pins. And you can see the ones and zeros changing there for each of the quadrier encoder pins as I turn the wheels. The two quadrier encoder pins allow us to determine which direction the motor is turning in. And then we can count how far it's gone. So the right hand columns are my three positions for each motor as I'm turning the wheels. And those swing positive and negative depending on which way I turn them. On each code loop, I'm bookmarking the value of the position of each wheel. And on the next code loop, I'm looking at the difference to see if it's bigger or smaller. Depending on how big the difference is, I can work out the velocity of each wheel, which is just the change in position.
Have you ever thought about getting 3D printed metal parts made for your projects? PCB way is a reliable one-stop shop for PCB manufacturing, assembly, but also other types of manufacturing services, including contract manufacturing, all under the same roof.
So you can get your whole project, prototype or product made at PCB way.
PCB way's metal 3D printing services include printing in aluminium, stainless steel, titanium, and tool steel. Options include tapped threads and inserts, and also part assembly. It's easy to upload your 3D part and get a quote to have it printed in metal, as well as other processes such as SLS, SLA, DLP, FDM in a variety of materials, including various resins, nylon, PLA, ABS, TPU, peak, and more. PCB way also offer a whole range of other manufacturing services such as CNC machining and sheet metal fabrication, injection molding, PCB manufacturing and PCB assembly. I actually ordered some CNC aluminium parts for my next project which is coming up soon. Yes, it's another big thing made of aluminium extrusion with metal plates of the joints made by PCB way. So look out for that coming up in a few weeks time. Use my special coupon code PCBway James Brutin10 at pcbway.com which I'll put in the video description as well. You can get $10 off on orders over $30 on PCBs and assembly, CNC, 3D printing, and other services. We need very accurate velocity control here, but before we can control the velocity, I need to install the motor drivers and get everything wired up. We also need some power. So, I have a 3S lipo in a little pocket on the top there, which provides 12 volts to the whole thing.
There is a main power switch that turns that on and I have a separate regulator which is providing 5 volts to the Vin of the ESP32 cuz the onboard regulator will almost certainly not deal with 12 volts from the battery. The 12 volts does go directly to the motor drivers though because they're 12vt motors. And the output from the motor driver goes to those two spare pins in that six wire connector on the motor to actually drive the motor. I'm using a PID controller for each wheel to control the velocity.
And I'll talk a bit more about PID controllers later in the video. If I set the motor running at a constant velocity and then load the wheel, we can see the red line dips down and that's the velocity decreasing as I load it. We can also see the green line increasing and that's the amount of current getting driven into it. So the controller is trying to maintain a constant velocity.
At the moment, I've just set up proportional controls. So the amount of current driven is directly related to the velocity. And I've ignored the other terms of the PID controller. So I now have somewhat accurate velocity control over all of my three wheels. And each one of those has got its own PID controller just to regulate velocity. So we will be using P for balancing. But we haven't done that part yet. For now, we just need to make sure that we actually have accurate control over the velocity of each wheel. We need to work out the ratio of the wheels so that we can drive in straight lines front and back and side to side. And when I tested this on the bike, we found that that back wheel in fact travels twice the distance of the slanted wheels. So that means we need that one to go twice as fast. So now driving forwards and backwards instead of using all three wheels of course only uses two because that back wheel is facing sideways. So that's very easy to work out. We just drive those two front wheels at the same velocity.
However, when we go sideways, it's slightly different to before cuz the wheel is turned 90°. So in fact what I found is that those two slanted wheels go 50% faster than the back wheel.
Normally with three wheels positioned like this we find a relationship with the number 0.5 in because the cosine of 60° is 0.5. To make it actually balanced though we need a controller that reads the angle of the inertial measurement unit and drives the wheel velocities.
This is the same as the previous bikes and robots that I've built. I'm using a P controller for this and there's an Arduino library which makes it super easy. The PID controller has three terms. The proportional term means that as the angle increases, the velocity increases. The input and output have a direct linear relationship. That's not enough to make it balanced though because we need to control acceleration.
And that's where we use the integral term, which is essentially the area under the graph. If the robot is falling over and the angle is constant, then as time goes on, the area under the graph gets bigger. So that makes the output increase. The output goes to the motor velocities which makes the wheels accelerate. If the angle increases over time, then the area gets even bigger and bigger, which causes even more acceleration so that the robot accelerates to catch itself. This can cause overshoot though, so the derivative term makes fast moves. The output looks like a sharp move perpendicular to the angle to damp the acceleration. All three terms need tuning together, but generally for balancing robots, there's a lot more integral than anything else and a very small amount of derivative gain relative to the proportional gain. My initial tunings from experience have made it pretty much balanced. And it looks like we've got those velocities correct front to back and left to right. It's not really that stable though, and it does wander off a bit. So, we probably need to work on this some more. If I put it on carpet, then the carpet helps damp the motion so it doesn't wander away, but it's also more effort to drive because the carpet is soft. So, with the same tunings, we can see it's kind of jittering around trying to make up the difference there in velocity, but not being able to. And then it's kind of oscillating. and it looks like it's making short, sharp, jerky motions.
Building a big balancing robot's actually much easier because it has much more mass and therefore it's much more stable because it doesn't fall over as quick. In the last video, I demonstrated balancing something with a big mass on the end of a stick and that's relatively easy. But when I try to balance something really small, then it's actually really difficult because it moves much quicker. So, to make life easier, I've added a number of M20 nuts to a tall stick on the robot. And now actually immediately it settles a lot better and it balances a lot more stably. So with the same tunings there's not really any issues there. It'll settle and it'll stay still on the spot.
There's a little bit of jitter but it's still quite small relative to the ball bike. And I'm also not sitting on it leaning which helps me with balancing the larger bikes.
Functionality includes motor start and stop buttons on the remote which means I can actually turn all the motors off if I want to reprogram it and put it on the ground without the wheels still running.
And I also have two trim pots and that's for trimming the left and right which just adds something to the angle to get it to balance in the middle and trimming the front and back so that we can get that perfectly balanced and settle in the middle. I've then got the joystick which adds something to my P set point which makes it lean at an angle and that means it has to drive. So that's a bit like leaning on the bull bike. Obviously we wanted to test rotating with that back wheel. So, my top button is also a shift button, which makes the joystick add some velocity to that wheel to hopefully make it rotate. But at this point, driving and rotating basically make it fall over. And it looks like we don't have enough velocity there really to actually catch itself if it's moving fast. We also have some wheel slippage.
If it moves too fast, then the wheels lose traction with the ball. And I've actually tried other balls, including a smooth ball, which as you'd imagine is much, much, much worse. And you can see the wheels spinning away there and not having any traction with that at all.
So, we've got no chance of using anything other than the grippy basketball. We can't do much about the traction other than driving carefully, but we can do something about the velocity. So, I've made a separate set of gears which will give us a much faster velocity of the wheel by gearing up from the motor. So, we now have much more capability for velocity, around 50% more. So, that's quite good. And that means it should be able to go faster to catch itself. So, I had to tune all of the PID controllers down because the output is now 50% faster, but that actually seems to be working okay. It is a bit jittery and probably needs some more working on, but I can kind of drive where I want to and pretty much it stays stable.
Sometimes though, if velocity increases too much, it pretty much loses it and then just can't be controlled. I am using the remote to try and hold it in place though. So I guess that's a bit like leaning on the ball bike. Although this feels much much more unstable. So I can kind of drive where I want and I can kind of get it to stay in one position.
But I am constantly manually compensating as well which doesn't feel very good. If I try and rotate it's okay in small doses and then I still have to catch it with the remote and make some quite big moves. If I move too much in that rotation axis then it loses it completely and runs away. And that seems to be fairly consistent that if I rotate it, it just seems to add some velocity and then it loses control completely and can't hold itself and I can't recover it with the joystick. Apart from that though, it's pretty stable and will sometimes settle on the spot by itself.
But just rotating is really really what makes it bad. There we go again. And off it runs.
Normally when a balancing robot can't be tuned, it means there's actually something wrong with it mechanically. In this case, I've actually geared up the backlash by gearing up the wheel ratio.
So, there's a huge dead spot in all of those wheels, which really isn't going to help me. The bike version used belt drives and also huge brushless motors that peak at 2 kW. So, there was no backlash and absolutely no problem with torque at low or high velocity. Do you remember when I set up the three velocity controllers for the wheels and I said that I just used a proportional response? So, the amount of current driven was linear in the relation to the velocity. What I've done now is added some integrator and that's going to help track the velocity better so that if we're not quite there, we get an acceleration in the current driven into the motor so that we can better track velocity and hopefully we can just accelerate through that bit of backlash and try and make the robot more stable.
And of course, those velocities come out of the balancing PID controller which still has very much a lot of integrator.
So now things are immediately much more stable and much more responsive because basically the wheels are doing what the PID controllers for balancing expect.
There is some jitter in the front to back axis and I think that's down to having only two motors instead of three controlling it because my balancing PD controllers still have the same values for both axes. A little bit of rotation works okay, but trying to drive and rotate or do anything too outlandish still causes me quite a lot of problems.
And I think that jitter is because of course three wheels are controlling this sideways. So we have 50% more torque and back to front we only have two wheels driving it. We don't have massive brushless motors. With the motors geared up, we probably still don't have enough actual power really. So we're right on the edge of what's possible. Otherwise, I can drive this just fine and it's pretty responsive. Apart from when I try to rotate and then everything, generally speaking, goes terribly wrong and it runs off. And I'm still not sure why that is.
So, let's try that rotation again. I can catch it sometimes with the joystick.
Small amounts are fine, but if I do too much or we go too fast, then it can't control itself. And I think some of that is wheel slip. And something else weird is happening when I try to rotate.
So, a nice bit of responsive driving there. moving that joystick quite a long way until I try and press that shift button and rotate and then basically it loses it and won't balance anymore.
The whole project is open source and all the CAD code is on GitHub and as I said at the beginning, patrons get enhanced downloads including the wiring diagram and some written documentation. If you think you know why I can't rotate this, then put the answer in the comments.
Related Videos

Setting up a curved screen with Immersive Calibration Pro 4 and multiple cameras (P3D v4)
FlyerOneZero
23K views•2019-07-21

Robot Learning with Sparsity and Scarcity
allenai
379 views•2025-10-14

Jorge Mendez-Mendez: Unlocking Lifelong Robot Learning With Modularity (2023-10-05)
umassmlfl
237 views•2024-01-06

Northwestern’s MS in Robotics: Student Robotics Projects, 2023
NorthwesternEngineering
1K views•2024-05-31

"Perfect" Turns: Turning by the Gyro - FIRST LEGO League (FLL) SPIKE Prime + EV3 RePlay Programming
ZacharyTrautwein
94K views•2020-10-02

Gorkem Secer: TSLIP-based Deadbeat Running Control of Bipedal Robot ATRIAS
DynamicWalking-wv6qm
298 views•2018-06-22

Self-Driving Cars Need Lessons On Human Drivers | Maddie About Science
skunkbear
26K views•2018-08-21

Milrem Robotics’ THeMIS UGVs used in a live-fire manned-unmanned teaming exercise
MilremRobotics
99K views•2021-05-20
Trending

MIC DROP: Smithsonian Director Called Out For Woke Propaganda
TheAmalaEkpunobi
37K views•2026-07-23

2.4 BILLION Records Got Leaked...
DeepHumor
15K views•2026-07-22

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23