nxtprograms.com

Fun Projects for your LEGO® MINDSTORMS® NXT!

Home     Projects     Help     Contacts

Balance Board
Building  
Programming  

Building Instructions


Programming Instructions

These two programs use the hub's internal gyro sensor to measure the tilt angle of the model and continuously apply a calculated amount of motor power to try to keep it balanced.

Warning: The hub gyro sensor appears to have a bug in it that sometimes prevents it from working. If the robot doesn't even come close to balancing, then try this workaround.

This first starter program shows a simple technique to get started with an automation control loop: a simple "Proportional Controller". A proportional controller is a common technique for a lot of automation tasks in the real world. It is normally not good enough to do a self-balancing task, but this Balance Board model is pretty stable (has a low center of gravity) and very close to balanced when on-center, so it doesn't take much to keep it upright:

This more complete program uses a more complex technique called a "PID Controller" (this stands for Proportional, Integral, Derivative). This is more complex mathematically than a simple proportional controller and is also harder to set up and adjust. However, it will balance the model more smoothly and reliably, including the ability to survive some bumps and nudges. Also, just for fun, this program includes some arm motion for the rider.

 

Home     Projects     Help     Contacts

 

Copyright © 2007-2021 by Dave Parker.  All rights reserved. 
All project designs, images, and programs are protected by copyright.  Please see the usage policy.