Friday, July 21, 2006

Hello Modular Programing

Hello, Ladies and Gentlemen, Boys and Girls, Robots and Droids and everyone else...

My name is Drew Stevenson, as Filip said I am a teacher who is very interested in Mindstorms both professionally and as a hobby. I have worked with NXT for many years, but I found alot had already been done by the time I started. Now I hope to contribute alot to basic and advanced users. I like to focus on ideas. If I present a robot its likely to be to show some ideas for modular incorperation in your own works. (much like DAZLR where the main focus was the shooting mechanism not the drive system - Thanks Brian Davis http://mindstorms.lego.com/MeetMDP/BDavis.aspx ).

To start off my contributions I'd like to (re-)introduce the idea of Modular programing. With the NXT's included software it is very easy to program seperate parts of a complex program and test them individually and then re-incorperate them into a larger more complex program. Those of you who might try to program complex routines are likely to run across bugs. These bugs can be either errors in the coding for the malfunctioning function or some conflict with another piece of code. It is hard to diagnose in mind sight. By building Blocks of Code which can be quality controled (like real lego bricks) and then snapped together, wired up and then tested as a whole. This can save lots of frustration.

Similarly I have come to realize that stock testing routines can be very helpful. I am working on a Sphere launching robot and my feed mechanism wasn't working right - it was jamming. I needed to troubleshoot. Was the problem a lack of motor delay (to allow a sphere to load) or was it motor speed? What motor power works best? All of these questions could have been tested by trial, reprogram, load, trial reporgram load, t,r,l.... etc. Even with Bluetooth this can be annoying.
Instead I made a program that would use those lovely NXT buttons to alter the power or delay time as the program runs. Up & down Value (also displayed) and enter for begin X rotations. Initially this program was just for motor C and one variable. I am working on an "introductory" interface which will allow a user to pick which motor or motor combos to test, what variable to alternate (the rest will have defaults) so that this program which is now going to take a while to make will be one stop shopping for 80% of my testing needs. Build a model, determine quickly the best settings for motors to do the job then program the job into an enviromentally aware robot.

Oh by the way I am loving the usability of the NXT buttons. Check them out - they can be found by placing a generic sensor block and then pulling down the pulldown list of sensor types. Then a new pull down appears to let you choose: left, right, enter buttons. A few switch assemblies and some displays (a few space keys and some mouse work and you can label the keys) and you can get an interactive display. My first experiments with this saw my Future wife answering a multiple choice "do you love me" Lots of happy faces and Horray!s when she pushed Yes. Of course we had to try no later for kicks. But I didn't put much effort into that one - just a sad face.

Please leave comments and descriptions of any programs you regularly reuse and think the rest of us should have in our back pockets.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home