Posts with «self balancing» label

Taming the Wobble: An Arduino Self-Balancing Bot

Getting a robot to stand on two wheels without tipping over involves a challenging dance with the laws of physics. Self-balancing robots are a great way to get into control systems, sensor fusion, and embedded programming. This build by [mircemk] shows how to make one with just a few common components, an Arduino, and a bit of patience fine-tuning the PID controller.

At the heart of the bot is the MPU6050 – a combo accelerometer/gyroscope sensor that keeps track of tilt and movement. An Arduino Uno takes this data, runs it through a PID loop, and commands an L298N motor driver to adjust the speed and direction of two DC motors. The power comes from two Li-ion batteries feeding everything with enough juice to keep it upright. The rest of the magic lies in the tuning.

PID (Proportional-Integral-Derivative) control is what makes the robot stay balanced. Kp (proportional gain) determines how aggressively the motors respond to tilting. Kd (derivative gain) dampens oscillations, and Ki (integral gain) helps correct slow drifts. Set them wrong, and your bot either wobbles like a confused penguin or falls flat on its face. A good trick is to start with only Kp, then slowly add Kd and Ki until it stabilizes. Then don’t forget to calibrate your MPU6050; each sensor has unique offsets that need to be compensated in the code.

Once dialed in, the result is a robot that looks like it defies gravity. Whether you’re hacking it for fun, turning it into a segway-like ride, or using it as a learning tool, a balancing bot is a great way to sharpen your control system skills. For more inspiration, check out this earlier attempt from 2022, or these self-balancing robots (one with a little work) from a year before that. You can read up on [mircemk]’s project details here.

Behold The Mega-Wheelie, a Huge One-Wheeled Electric Skateboard

DIY electric personal vehicles are a field where even hobbyists can meaningfully innovate, and that’s demonstrated by the Mega-Wheelie, a self-balancing one-wheeled skateboard constructed as an experiment in traversing off-road conditions.

[John Dingley] and [Nick Thatcher] have been building and testing self-balancing electric vehicles since 2008, with a beach being a common testing ground. They suspected that a larger wheel was the key to working better on rough ground and dry sand and tested this idea by creating a skateboard with a single wheel. A very big, very wide wheel, in fact.

The Mega-Wheelie houses a 24V LiFePO4 battery pack, 450 W gearmotor with chain and sprocket drive, SyRen motor controller from Dimension Engineering, Arduino microcontroller, and an inertial measurement unit to enable the self-balancing function. Steering is done by leaning, and the handheld controller is just a dead man’s switch that disables the vehicle if the person piloting it lets go.

Design-wise, a device like this has a few challenging constraints. A big wheel is essential for performance but takes up space that could otherwise be used for things like batteries. Also, the platform upon which the pilot stands needs to be as low to the ground as possible for maximum stability. Otherwise, it’s too easy to fall sideways. On the other hand, one must balance this against the need for sufficient ground clearance.

Beaches are rarely covered in perfectly smooth and firm sand, making them a good test area.

In the end, how well did it work? Well enough to warrant a future version, says [John]. We can’t wait to see what that looks like, considering their past 3000 W unicycle’s only limitation was “personal courage” and featured a slick mechanism that shifted the pilot’s weight subtly to aid steering. A video of the Mega-Wheelie (and a more recent unicycle design) is embedded just below the page break.

And just for reference, here is some of [John]’s previous work on a self-balancing unicycle design.

Building D-O, The Cone Face Droid

For many of us, movies are a great source of inspiration for projects, and the Star Wars films are a gift that just keeps giving. The D-O droid featured and the Rise of Skywalker is the equivalent of an abandoned puppy, and with the help of 3D printing, [Matt Denton] has brought it to life. (Video, embedded below.)

D-O is effectively a two-wheeled self-balancing robot, with two thin drive wheels on the outer edges of the main body. A wide flexible tire covers the space between the two wheels, where the electronics are housed, without actually forming part of the drive mechanism. The main drive motors are a pair of geared DC motors with encoders to allow closed-loop control down to very slow speeds. The brains of the operation is an Arduino MKR-W1010 GET on a stack that consists of a motor driver, shield, IMU shields, and prototyping shield. [Matt] did discover a design error on the motor driver board, which caused the main power switching MOSFET to burst into flames from excessive gate voltage. Fortunately he was able to work around this by simply removing the blown MOSFET and bridging the connection with a wire.

The head-on D-O is very expressive and [Matt] used four servos to control its motion, with another three to animate the three antennas on the back of its head. Getting all the mechanics to move smoothly without any slop took a few iterations to get right, and the end result looks and moves very well.

[Matt] worked on the film himself, so he based his build on a design by [Michael Baddeley], another prolific droid builder, to avoid breaching his NDA. He covers the entire development and testing process in a series of videos, and will be releasing the design files and instructions when it’s done.

Balancing Robot Needs Innovative Controller and Motor

A self-balancing robot is a great way to get introduced to control theory and robotics in general. The ability for a robot to sense its position and its current set of circumstances and then to make a proportional response to accomplish its goal is key to all robotics. While hobby robots might use cheap servos or brushed motors, for any more advanced balancing robot you might want to reach for a brushless DC motor and a new fully open-source controller.

The main problem with brushless DC motors is that they don’t perform very well at low velocities. To combat this downside, there are a large number of specialized controllers on the market that can help mitigate their behavior. Until now, all of these controllers have been locked down and proprietary. SmoothControl is looking to create a fully open source design for these motors, and they look like they have a pretty good start. The controller is designed to run on the ubiquitous ATmega32U4 with an open source 3-phase driver board. They are currently using these boards with two specific motors but plan to also support more motors as the project grows.

We’ve seen projects before that detail why brushless motors are difficult to deal with, so an open source driver for brushless DC motors that does the work for us seems appealing. There are lots of applications for brushless DC motors outside of robots where a controller like this could be useful as well, such as driving an airplane’s propeller.


Filed under: robots hacks

Self-balancing unicycle using Arduino and Sparkfun IMU

Here’s proof that you can build cool stuff with simple tools. This self-balancing unicycle uses an Arduino and a five degree of freedom IMU from Sparkfun to keep the rider upright. Well, it’ll keep you upright as long as you have good side-to-side balance. But that’s true of any unicycle, right?

The Raptor was built by [Nick Thatcker] who is no stranger to self-balancing transportation. A few years back he built a Segway clone and the same type of geared motor used in that project also went into this one. I connects to the wheel with a chain, allowing him to keep the motor hidden in the saddle. He gets between 90 and 120 minutes of used on one charge with a top speed of 10 MPH. The motor could move you along faster but he has limited this in firmware to ensure it has enough power to ‘catch up’ if you lean too far forward.

Don’t miss the demo after the break. If you like this unicycle there are several others worth looking at.


Filed under: transportation hacks

Wii Nunchuck controlled robot exhibits rock solid balancing

[Willy Wampa] is showing off his self-balancing robot. What strikes us about the build is how well tuned his feedback loop seems to be. In the video after the break you will see that there is absolutely no visible oscillation used to keep its balance.

The parts used are quite easy to obtain. The acrylic mounting plates are his wife’s design and were custom cut through the Pololu service. They were also the source of the gear motors. He’s using a SparkFun IMU with an Arduino and a motor shield. He first posted about the build about a month ago, but the new revision switches to a Pololu motor driver shield which he says works much better, and adds control via a wireless Wii Nunchuck.

The PID loop which gives it that remarkably solid upright stance is from a library written by [Brett Beauregard]. Once again the concept of open source lets us build great things by standing on the shoulders of others.

[via Reddit]


Filed under: robots hacks
Hack a Day 25 Sep 18:01

Self balancing robot uses cascading PID algorithms

At this point we’re beginning to think that building a self-balancing robot is one of the rights of passage alongside blinking some LEDs and writing Hello World on an LCD screen. We’re not saying it’s easy to pull off a build like this one. But the project makes you learn a lot about a wide range of topics, and really pushes your skills to the next level. This latest offering comes from [Sebastian Nilsson]. He used three different microcontrollers to get the two-wheeler to stand on its own.

He used our favorite quick-fabrication materials of threaded rod and acrylic. The body is much taller than what we’re used to seeing and to help guard against the inevitable fall he used some foam packing material to protect the top level. Three different Arduino boards are working together. One monitors the speed and direction of each wheel. Another monitors the IMU board for position and motion feedback, and the final board combines data from the others and takes care of the balancing. Two PID algorithms provide predictive correction, first by analyzing the wheel motion, then feeding that data into the second which uses the IMU feedback. It balances very well, and can even be jostled without falling. See for yourself in the clip after the break.


Filed under: robots hacks
Hack a Day 20 Jul 21:01