Having reported on the LEGO ROBOLAB Kit in April 2005, it seemed
natural to write a sequel to that article based on the MINDSTORMS[R] NXT
Robotics Toolset. The newer kit definitely has gone up-market in its
programmability and sensor and motor capabilities. There is much less
emphasis on low-level gearing and mechanical engineering in contrast to
the earlier ROBOLAB that had basic motors.
[ILLUSTRATION OMITTED]
In the MINDSTORMS kit, the motors include gear reduction as well as
angular feedback sensors. Accordingly, you can program a motor to turn
clockwise for 180 degrees at a certain speed. That would have been
difficult if not impossible in the earlier product.
A tremendous amount of effort has gone into the step-by-step
on-screen instructions for the various models. For example, there are 60
illustrated steps to build a robotic arm and an additional 16 steps for
a hand. Given the complexity of some of the models, this effort is
necessary to ensure a satisfying user experience, as they say.
Nevertheless, some of the illustrations show only one piece being added.
Perhaps an exploded view with explanatory text would be an alternative
approach worth considering.
Programming also is very different from ROBOLAB, reflecting some of
the changes introduced in recent versions of LabVIEW. Although wires can
be used to interconnect ports on icons, you seldom need to. Instead,
most of an icon's behavior is determined by parameter values
entered on a form.
When programming, you start with the common palette, which is
useful, but the options offered by the complete palette are more
interesting. At least initially, I felt I had to work hard to overcome
what seemed like excessive graphic gimmicks. There are self-locating
blocks, lots of different colors and shapes, and very large symbols.
Icons are positioned on a sequence beam, which greatly limits the
types of networks you can build, especially compared with ROBOLAB. A
positive result of constraining the arrangement of icons is very
predictable program execution. As I found, the real power of a program
is in the configuration panels.
Without reading any instructions, you soon learn that clicking here
and there opens up connector blocks on the icons. It's helpful that
the wires are different colors for different kinds of data, and if you
connect two things that shouldn't be connected, the wire goes dotty
and grey. However, in my experience, it wasn't necessary to wire
the icons together at all because the control-panel information was very
comprehensive. Nevertheless, I'm sure that advanced MINDSTORMS
builders find wiring useful.
Installing the software on my PC wasn't completely
straightforward, and after installing it, you are exposed to LEGO and
other advertising. You need to restart the computer for the short-cut
icon to appear. After doing that, I could get the MINDSTORMS software to
start up.
Example
A general comment on LEGO construction: It helps to have the parts
spread out in a large flat box. There may be some kids that are so
organized that they actually keep similar parts in separate containers;
however, I suspect that most of the time all the parts end up mixed
together. Finding a specific component among the 571 that make up the
kit is helped by color and having only a layer or two to work through.
Initially, it's easy to find a part because there are several
of each type. But as the project nears completion, you are trying to
locate one particular part, and it can be difficult if you can't
spread out all the remaining components.
Rather than dive into a pre-engineered example, I wanted to become
familiar with the kit by building something original. My idea was to
make a mechanism that had balls drop down slides and eventually get
picked up and recirculated over and over.
[FIGURE 1 OMITTED]
Two motor drives were required: one to close a pair of jaws around
the ball and the other to swing the ball and jaws up and over to a track
and then release the ball and return to the original position. I
didn't build the track but did complete the necessary programming
for the LEGO mechanism. Figure 1 shows the operation of the model as a
progression of separate positions.
Because I didn't know where the main arm would be positioned
at the start of the program execution, I programmed the drive motor to
traverse the arm relatively slowly to the right until a stationary
photodetector triggered on a sufficiently high light level reflected
from the white beam on the side of the arm. That action stopped the main
motor and started a second motor that activated the jaws.
I used a worm gear as a rack driven by a pair of pinions geared
together and turning in opposite directions on either side of the rack.
This linear motion activated a symmetrical bell-crank arrangement that
opened and closed the jaws, actually more like a pair of claws
interleaved to grab and hold one of the 2" balls.
After the photodetector triggered and the main motor stopped, the
claw actuator motor was started and ran a short amount of time until the
touch actuator was pressed. The mechanism was designed so that the jaw
opening would be more than sufficient to drop the ball but not so wide
that the bell cranks would jam. Also, the jaw opening could not be too
narrow to restrict tolerance in the positioning of the next ball to pick
up.
Having dropped the ball, the machine was in a known state set by
two reliable sensors. A short 3-s wait icon held the machine in that
state. Because the main motor drives a fixed gear ratio, it was simple
to compute that the arm would reach the desired position at the other
side of the machine after 1,120 degrees of rotation. As a result, a main
motor icon was inserted and its panel programmed for 1,120 degrees with
braking after the rotation.
Also, the claws then needed to be closed by running the second
motor. Because of the design of the mechanism, a rubber-band drive was
the easiest to implement and acted as an overriding clutch, providing
holding power for the jaws after the motor had stopped. I deliberately
programmed the motor to run a little longer than required so the rubber
bands would be stretched.
By using a sensor to determine one end point in each of the
mechanical loops, both the claws and the traversing mechanism could
operate repeatedly without tolerance build-up.
Programming
I simply couldn't understand why I was having very basic
programming problems. In desperation, I e-mailed MINDSTORMS but never
received a reply or acknowledgement. Finally, I contacted an
acquaintance at National Instruments, and soon the problem was solved.
In effect, each icon in the program describes a state. For example, you
may insert a motor icon and in its associated control panel set a number
of conditions, such as run clockwise forever with servo feedback to hold
a 50% speed.
I had assumed that if I put a similarly configured motor inside a
while loop that when the loop terminated the motor would stop. No, the
motor's local variables set on its control panel take precedence.
When I tried to run that kind of program, the motor did indeed stop, but
only because the program had stopped.
To gain control of the motor, you must insert another motor icon on
the sequence beam but with different conditions programmed into the
icon's setup panel. You could have a motor icon set to run forever,
then a wait icon set to 10 s, and finally another motor icon set to
stop. That kind of process underlies operation of any MINDSTORMS
program.
However, because the programming panels work at a high level of
abstraction, you can directly program a single motor icon to run for 10
s, avoiding the need for three separate steps. In addition, you can
specify whether the motor should coast to a stop or brake. And, you can
allow further program steps to execute while the motor runs or inhibit
the program from moving on until the motor motion completes.
Obviously, there is a lot of powerful low-level software running in
the background to support the actions programmed on each panel. All of
this motion control required for the machine was possible using only six
icons, giving some idea of the high-level nature of MINDSTORMS.
Additional icons that I did not use have even more functionality. The
move icon allows simultaneous control and synchronization of at least
two motors necessary to simplify programming Rex the Robot to walk.
Also, the basic while loop could be linked to the state of a
particular sensor. For example, if the loop were to run until the touch
sensor was pressed, the loop icon would include the touch-sensor symbol,
and the control panel would present appropriate choices such as actuate
when pressed, when released, or when depressed 50%.
A lot of detail is handled on the individual panels associated with
the elements, which makes the overall diagram higher level and cleaner.
On the other hand, there's no way that a MINDSTORMS diagram is
self-documenting to the degree a ROBOLAB diagram is. There is so much
detail hidden in the panels that you have very little information on the
diagram with which to work.
Construction
This kit uses the TECHNIC[R] beam-and-pin type of construction
found in many LEGO mechanical kits. In common with ROBOLAB, the
controller block can be built into the mechanism. Similarly, there are
plenty of attachment points for the motors and sensors.
COPYRIGHT 2008 Nelson
Publishing Reproduced with permission of the copyright holder. Further reproduction or distribution is prohibited without permission.
Copyright 2008 Gale, Cengage Learning. All rights
reserved. Gale Group is a Thomson Corporation Company.
NOTE: All illustrations and photos have been removed from this article.