3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Seg...stick.

Step 8Software overview.

The Segstick's software is written in C for the Arduino. The full software is attached below as a text file. It's only about 120 lines of code, aided somewhat by the convenient Arduino libraries. The code is commented, but for the next few steps I'll go through the important parts of the control algorithm, since this is where the magic happens.

The feedback controller really has two critical components: a digital filter that merges signals from the accelerometer and the gyro into a reliable angle estimate, and a proportional-derivative (PD) control algorithm that determines the corrective action to create by outputting voltage to the motors. These two components are the key to making a good self-balancing platform.

Other less glamorous but also important ancillary functions are signal input and scaling, steering, PWM generation, output limiting, and debugging. I'll briefly mention these, too, in the next few steps.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
19
Followers
1
Author:scolton