Idea 1: Graphs to Motion

Students can use a customizable app created using Processing to drag out a position vs time graph or a velocity vs time graph. When students press the "Run Car" button, the graph's instructions are sent to an NXT via bluetooth which then moves according to the graph. This idea came from what Matt Greenwolfe has done using Scribbler 2 Robots from Parallax.

The apps look like this to the students. Students simply click and move the mouse several times to form a connected line segment graph. Since the line segments are thick, it must be noted that the value of each line segment is based on the bottom of the segment.

Each graph is customizable inside their source programs by editing NXTpositionVsTime.pde and NXTvelocityVsTime.pde. You can change the min and max position and velocity values as well as the min and max time values which will redisplay with evenly spaced values along each axis. You can also change the graph titles and axes titles.

The NXT's serial port must be known in order for the app to establish a connection to it. This can be found using bluetooth preferences on your Mac or PC. For a Mac with only one NXT ever connected via bluetooth, the device name will be TTY.NXT-Dev-B.

A text file named "RunCar.txt" is created on the NXT when the "Run Car" button is pressed. This means if the NXT is pre-loaded with the myblock "RunCar", the student simply runs the "RunCar" program on the NXT and it performs the graphed motion.

NOTE: The car design I use allows the car to move with a maximum speed of 40 cm/s. MoveCar is currently programmed to make a loud beeping sound whenever either motor hits power 100 because any data taken will be messed up by either motor hitting the top speed. The graphs, however, are not limited to only physically feasible graphs so you may hear some beeping when doing this with your classes!

DOWNLOADS FOR THIS IDEA

Processing App is used to customize the graphs and create your own stand-along app (Mac, PC and Linux) for students to use. Processing version 1.5.1 works on Snow Leopard. I have not attempted this on Lion or later but there is a version 2.2.1.

NXTpositionVsTime Folder and NXTvelocityVsTime Folder are the folders containing the programs which can be run in order to customize graph options (NXTpositionVsTime.pde and NXTvelocityVsTime.pde).

Opening NXTkinematicsFiles.rbtx on your computer will install all the useful myblocks used to run my NXT files. RunCar.rbt is the myblock you will want to find and download to the NXT for this idea.