The MOVE block
In the NXT programming language, you use BLOCKS to program your bot. I'm going to cover many of them, but I figured I'd start with a rather important one... the MOVE block.

This is a fragment of the LEGO NXT software desktop... the MOVE block is represented by the 2 gears. You drag this block onto the desktop to begin configuring it.

After dropping it on the desktop, it becomes this green block. These blocks are nice in that they do show some visual information on the block. I can look at this one and tell that it has defaulted to controlling Motors C and B. I can also tell that is defaults to have the motors move "forward" - I use the word in quotes because it does depend on how you have the motors configured. If you turn the motors 180 degrees, the terms "forward" and "backward" switch. Likewise, if you say that "forward" is "motor turns counter-clockwise" be careful. Flip the motor vertically 180 degrees or spin it horizontally 180 degrees, and the controls change I can visually see how much power has been applied (the middle orange icon that looks like a little gauge) and the last orange icon on the bottom right tells me if the motors is configured to turn a specific number of degrees, for an unlimited time, for a specified number of seconds, or (in this case) a specific number of rotations.

This image shows the configurable controls for the MOVE block. You can see where you can select Motors A, B, and/or C to control. Direction is next (up arrow is forward, down arrow is backward, other symbol is stop). Steering isn't my favorite control because I just don't use it that often. You can configure a bot to perform a slow or fast turn in the direction of the motors you select (B or C) by dragging the little controller left or right. The power allows you to set the speed of the motor (how fast it turns) and the Duration drop-down menu allows you to select "Unlimited" (spins until a condition stops it or YOU do) or define a number (in the other field - it shows a 1 in the image) to correspond to "Degrees", "Rotations", or "Seconds." Finally, you can choose to "Brake" or "Coast"... braking stops the bot's motor(s) immediately but takes power to do so... coasting saves on battery power, but doesn't give you good stopping control.
More block coverage to come...

This is a fragment of the LEGO NXT software desktop... the MOVE block is represented by the 2 gears. You drag this block onto the desktop to begin configuring it.

After dropping it on the desktop, it becomes this green block. These blocks are nice in that they do show some visual information on the block. I can look at this one and tell that it has defaulted to controlling Motors C and B. I can also tell that is defaults to have the motors move "forward" - I use the word in quotes because it does depend on how you have the motors configured. If you turn the motors 180 degrees, the terms "forward" and "backward" switch. Likewise, if you say that "forward" is "motor turns counter-clockwise" be careful. Flip the motor vertically 180 degrees or spin it horizontally 180 degrees, and the controls change I can visually see how much power has been applied (the middle orange icon that looks like a little gauge) and the last orange icon on the bottom right tells me if the motors is configured to turn a specific number of degrees, for an unlimited time, for a specified number of seconds, or (in this case) a specific number of rotations.

This image shows the configurable controls for the MOVE block. You can see where you can select Motors A, B, and/or C to control. Direction is next (up arrow is forward, down arrow is backward, other symbol is stop). Steering isn't my favorite control because I just don't use it that often. You can configure a bot to perform a slow or fast turn in the direction of the motors you select (B or C) by dragging the little controller left or right. The power allows you to set the speed of the motor (how fast it turns) and the Duration drop-down menu allows you to select "Unlimited" (spins until a condition stops it or YOU do) or define a number (in the other field - it shows a 1 in the image) to correspond to "Degrees", "Rotations", or "Seconds." Finally, you can choose to "Brake" or "Coast"... braking stops the bot's motor(s) immediately but takes power to do so... coasting saves on battery power, but doesn't give you good stopping control.
More block coverage to come...
Comments
I notice you mentioned that the motor can be turned a specific number of degrees and then braked to stop.
Can you or anyone else comment on this motor's stepping accuracy? If, for example, you attached a long beam to it (preferably off to one side so it is unevenly loaded) and stepped it 1 degree at a time 360 times (with braking), would the beam end up where it started?
If the resolution of the degree stepping is less precise, that's not a big concern. I'm more interested in whether a NXT-based turtle has a chance of winding up where it started if it's told something like "repeat 12 [forward 100 right 30]".
As soon as I can test this, I'll do it for you... it might be a few days or so... things are going to be busy for the next few days.
Jim
Is it based on LabVIEW?
- Jake Covert
jakecovert [at] gmail [dot] com
How about this added tidbit: every now and then during that last test, I pushed my thumb against the turning axle to increase the friction... a few times I even just held the axle while the motor "fought" me to try to turn it. It did not alter the accuray (i.e., regardless of load or even completely blocking the motor for a moment, the rotations were 120°, exactly as requested).
As to making a NXT-based turtle, it's certainly possible, but you have to ask how fast you want it to move, and what accuracy you really need. For instance, there is some play (a couple of degees perhaps) in the motor, so even though the measurement accuracy is around 1 degree, it does not imply perfection under all circumstances. And of course if a wheel skids, all the encoder accuracy in the world won't help you.
--
Brian Davis
--
Brian Davis
> Can you or anyone else comment on this
> motor's stepping accuracy?
I tried the test you suggested on my NXT (like Jim, I'm in the MDP), asking the motor to turn 1 degree 360 times, with a slight pause inbetween. The result was a 360° cumulative rotation, to within an accuracy of a couple of degrees. Considering that the mechanical slop in the geartrain is on the order of a degree or more, I think this is acceptable.
Another test I tried out was to have the motor turn 120° forward, pause, and then turn 120° in reverse and pause, and to repeat this process 50 times. The end result was the motor returning to within one degree of the inital position. Perhaps more impressive, I did not let the motor run in a stress-free" environment: during that test, I pushed my thumb against the axle to vary the load on the motor, and even stoped the rotation completely several times, blocking the motor from turning. As soon as the motor was released, it dutifully completed its rotation and continued. Personally, I'm fairly impressed by this :).
> I'm more interested in whether a
> NXT-based turtle has a chance of
> winding up where it started if it's
> told something like "repeat 12
> [forward 100 right 30]"
I think that depends on how you design the turtle, and what you mean by "where it started". After all, there's a lot of things going on besides the motor accuracy in such an application. For instance, the tires can not skid at all, or change their radius of curvature at all, you have to reduce mechanical slop as much as possible, etc.
--
Brian Davis
I hope to test this as soon as possible when my set is comming in somewhere in august or oktober as what they are saying right now to me from Shop@Home...
I'm really looking forward to take this into testing and find my ways to make it as good as possible..
The precision isn't perfect... but it's worlds better than with the RCX, even with the rotation sensors. And for a kid, it's virtually automatic.
--
Brian Davis
George
Jim