Fun Projects for your LEGO® MINDSTORMS® NXT! |
Balance Board |
|
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.
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.
|
Copyright
©
2007-2021 by Dave Parker. All rights reserved. |