Do-it-yourself self-balancing...things...have been around almost as long as commercial self-balancing things. Obviously the homemade versions are not as smooth, reliable, or failsafe as the real thing, but they are still pretty captivating. And they make great mechanical/electrical builds with some interesting control theory mixed in. In the final step, I provide a few references to good DIY self-balancing...whatever...builds.

In 2007, I helped with this other self-balancing scooter build at the MIT Edgerton Center, and since then we've gotten many interesting questions by email about how it works. Baseline self-balancing functionality is actually surprisingly simple, and maybe the purpose of this Instructable is to take this simplicity to the extreme. To that end, I present: Seg...stick.

Segstick is a self-balancing...well, literally some kind of broomstick I found in the MITERS workshop. It is powered directly by two DeWalt cordless drills chucked to two 6" wheels. The controller is an Arduino. Additional supporting devices include an Inertial Measurement Unit (IMU) from Sparkfun and two motor drivers from Pololu.

Is it the best DIY self-balancing vehicle ever? No, not even close. But it only took about two days to build, and it is stripped down to the bare necessities. Thus, I hope to point out the modules and concepts involved in making any self-balancing vehicle rather than the specifics of this one. To start with, some physics...

Step 1: Physics says it's easier to build a full-size self-balancing thing.

One question we get a lot is: Can this work on some kind of miniature self-balancing robot? Yes, but, the laws of physics make it harder to control a small inverted pendulum bot than a full-sized rideable self-balancing vehicle. 

For one, the mechanical time constant of a small self-balancing robot is faster. Imagine the difference between trying to balance a broomstick on your finger and trying to balance a pencil on your finger. The controller for a small robot has to be that much faster to keep up with the physical system.

Additionally, a human rider takes some of the burden off the electronic controller, since the human mind is a pretty good controller too. For example, the accelerometers used on self-balancing platforms can't distinguish between standing still and moving at a constant velocity, but a human rider can. The human rider can adjust by leaning forwards or backwards to speed up or slow down.

So, this Instructable focuses on a full-size vehicle, albeit a relatively small one. In the final step, there are some links to balancing robots.
<p>Wow...Its really awesome</p>
<p>This is very coooool!!!</p>
<p>Qu&eacute; buena idea! Cool!!</p>
<p>VEry good work</p>
<p>I'd love one of these around our campus.</p>
<p>Great idea</p>
<p>Ttoooo good.. thaxx for sharing</p>
<p>lovely, creative</p>
amazing.i am going follow your instructions to make one.but i know nothing about programing and electrions.so dont think my questions are simple and stupid.i really dont know.<br>1.Can i use different motor driver?<br>2.Can alter the structures of the car(eg distance between two wheels,size of standing board....)<br>if these changes will effect the program to run smoothly?<br>thanks
answer, please! what is the function of steering pot? How it affects on the controlling of ballancing robot?
The steering pot applies a differential command to the motors, after all the balancing calculations. It adds some amount to one motor and subtracts some amount from the other motor, which causes the platform to turn. The amount it adds and subtracts is set by the steering gain, KS.
<p>Can i get the demo video of this, i am planning to buy something similar to this.</p>
<p>You can make it if you follow the instructions</p>
<p>Yeah, can we make it together?</p>
<p>This Segstick really very good?</p><p>I want it too...))</p>
<p>very easy instructions </p>
<p>Can i get the demo video of this, i am planning to buy something similar to this.</p>
<p>Just a note to let you know I have added this to the collection: Cordless Drills Hacking for Other Uses !</p><p>&gt;&gt; <a href="http://www.instructables.com/id/Cordless-Drills-Hacking-for-Other-Uses/" rel="nofollow">http://www.instructables.com/id/Cordless-Drills-Hacking-for-Other-Uses/</a></p><p>Take a look at a bunch of project involving odd uses of drills.</p><p>and for even more drill info</p><p>&gt;&gt; <a href="http://www.instructables.com/id/Cordless-Drills-A-Collection-of-Collections/" rel="nofollow">http://www.instructables.com/id/Cordless-Drills-A-Collection-of-Collections/</a></p>
<p>Regarding Step 10,</p><p>I've seen accelerometers with specs that say 'capable of measuring accelerations with output data rates from 1 Hz to 10 kHz'.</p><p>If the motion will be under 10khz, do you think a gyro is still needed? Or will the readings be so noisy that even when operating under 10khz, the accelerometer data will still need to be filtered with gyro data?</p>
<p>awesome stuff.. cheers</p>
<p>it is awesome no doubt</p>
<p>very nice indeed</p>
<p>nice stuff</p>
<p>awesome stuff.. thank you</p>
<p>great stuff</p>
<p>awesome stuff great</p>
<p>You Sir, are a legend.</p>
<p>sure thing</p>
<p>yes sure</p>
<p>I understand that the point of this build is the balancing part... but I'm interested in everything but that part. </p><p>My son has muscular dystrophy and is in a wheelchair full time. Visiting other peoples houses can be tough because the wheelchair is so big and heavy. I've been looking for a solution for a smaller footprint chair to bring into a home and I think this is it.</p><p>I'd keep the platform/drill/wheels, but skip the stick part and replace that with a joystick. Seems to me like it shouldn't be hard to have a joystick as input and have the arduino calculate the values for the motor drivers. (Not that I have any idea how to do it -- but it seems a lot simpler than making it self-balancing)</p><p>Here's an idea of the chair that I would mount the platform on...</p><p><a href="http://jenmadeit.com/2014/02/14/scooter-to-chair-upgrade/" rel="nofollow">http://jenmadeit.com/2014/02/14/scooter-to-chair-upgrade/</a></p><p>Do you think this is a possibility? I have no soldering or electrical experience. What are the odds that you could help me build it???</p>
<p>It's amazing. Maybe I'll make a tool like that by my batteries. Can <a href="http://edewalt18vbattery.blogspot.com/2014/03/dewalt-dc-9096-2-18v-battery-review.html" rel="nofollow">this battery</a> be replaced the 18v battery lith?</p>
Wow this is crazy! I could never build this, but my husband is really handy, so I might have to get him to take a look.
<p>Great </p>
Can you please tell me where I can find the schematic for the controller board. Machine Science is asking for BOM + schematic + CPL. I could not find those. <br> <br>Thanks <br>-r
The controller on this project is different from the one on the &quot;DIY Segway&quot; project, which was based on a Machine Science board. This one is simply and Arduino Nano (manufactured by Gravitech, sold by many distributors) connected to sensors as in Step 7. Unfortunately, it seems that Sparkfun has discontinued the 6DOF Razor IMU in favor of newer, cheaper digital versions. I haven't converted this project over to digital sensors yet, so you'd have to adapt it on your own. <br> <br>Hope that helps!
Thanks Scolton for your reply. Do you think using the newer sensor to be a challenge? I ask this since I have no experience what so ever working with electronic boards and sensors. Was the older sensor an analog one? And does the new one still connect to the same ports as the older one?
How did you calculate the angle from the accelerometer? none of my values from several different methods seem to work very well, or line up with the angle from the gyro.
Steps 9 and 10 have all the details for how the accelerometer and gyro are merged together to create an angle estimate. I also have it in Steps 14 and 15 of my PCB Quadrotor instructable for a different IMU. <br> <br>For the accelerometer, I use a small-angle approximation that says sin(theta) ~ theta, in radians. This is good to within 5% between -30&Acirc;&ordm; and 30&Acirc;&ordm;. So, to get the angle you need to subtract a &quot;zero&quot; value and then scale by the correct constant. <br> <br>If you need to work outside of -30&Acirc;&ordm; to 30&Acirc;&ordm;, the most common method is to take the arctan of two accelerometer axes.
hi scolton.<br>here i got 2 18x25 pololu motor driver but the pins are<br>TIXN<br>ERR<br>RST<br>TX<br>RX<br>VIN<br>GND<br><br>instead of<br>V+<br>5V<br>FF2<br>FF1<br>RESET<br>PWM<br>DIR<br>as shown in your 18x25 motor driver<br><br>so plz tell me what r the PWM &amp; DIR pin in my motor driver.<br>
Seems like you got the 18v25 Motor Controller instead of the 18v25 Motor Driver. Pololu separates &quot;drivers&quot; which have no on-board logic from &quot;controllers&quot; which have an on-board microcontroller. Drivers take a PWM and direction input and directly send it to the motor. Controllers need a different kind of interface. <br> <br>On the controller, you should be able to use the RC interface (pins labeled RC1 and RC2) and the Arduino servo library to command the motors.
Where did you get the heat sinks for the Polulu High-Power 18v25 motor drivers and how did you attach them? <br> <br>A picture would be nice... <br> <br>thanks

About This Instructable


228 favorites


More by scolton: PCB Quadrotor (Brushless) Seg...stick.
Add instructable to: