Saturday, June 28, 2008

What Engineers Must Do


As an engineer, I am forced to spend my idle brain cycles on thoughts of control loops, microcontrollers, and the eternal question: "Hmm, I wonder how that works?" I saw a youtube video of one of these and knew then that I had to build one for myself.

The gizmo in the video is known as an SBR, or Self-Balancing Robot. Until Dean Kamen built his Segway, things like this were known as inverted pendulums. I bought the Lego set for work last year ($250 @ Hobbytown or Toys R Us) to inspire innovation within the lab team. One of the guys built and tweaked some of the designs in the instruction book, I built a CD-labeler with it, another engineer built a mini-mower, and that's been it.

The kit includes a cool little controller that you can talk to via USB or bluetooth, three servo motors, a sound sensor, light sensor, a push-button switch, and a bunch of lego parts. The controller is programmed with a pre-school version of LabVIEW (the language I use @ work to make real things), or it can be programmed with a real programming language called NBC. The key to a self-balancing robot is the $50 aftermarket solid-state gyro that I bought for it from www.hitechnic.com. We truly live in a fantastic time.

I did all of the programming from scratch in the pre-school NXT LabVIEW. It's controlled entirely by a PI loop. I have it setup for a PID loop, but was able to get it working well enough with just P & I that I grabed the camera and shot some video. I need to tune it a little better and I want to be able to drive it around via a bluetooth coversation from my pocket PC. The code is ugly and has a lot of hard-coded crap in it that needs to be fixed so that the user can modify settings via the front panel display buttons.

Once the NXT version is working, it will be time to build a PIC-based unit...

Go to YouTube and search for NXT videos. It's amazing what everyone is making with legos.

Posted by Picasa

No comments: