Friday, February 24, 2006

Throw Away Your RCX?

On Nabble, Liz Bilbro wrote:

I'm in my 4th year of teaching LEGO robotics to homeschoolers, holding LEGO robotics camps, and coaching FLL teams. Right now I have almost 30 kids in my classes, and am looking at my summer camp schedule and teaching LEGO robotics at the local U., and my fall schedule.

This has me staring at my investment of 20 RIS sets and thousands of dollars in extra motors, sensors, gears, not to mention probably 50 pounds or so of extra parts.

Is it all a waste?
Should I sell it all on eBay?
Is anyone going to be supporting LEGO RCX robotics in Education? (I've been
using Carnegie Mellon, but they're off with the NXT, it appears...)
Can I use many of these parts if I switch the NXT?
Will any of our ROBOLAB knowledge help us with the new language?

Will any of us be able to buy an NXT in a reasonable time to figure any of this out?

Just wondering... Anyone have any opinions?


I decided to bring that over to my blog, since the answer is probably useful to many people, now and in the future.

For those people who are looking at upcoming investments, my advice would be to hold off any purchases of the Lego Mindstorms, until the Lego Mindstorms NXT will be released in about 6 months. Clearly, I’m not helping Lego’s commercial interests here, but I believe the value that the NXT set brings does matter. I have written or commented about this here, here and here.

But, as Liz asks, what about people who have literally thousands of dollars invested in the Mindstorms RIS sets?

If I was teacher in that position, I would teach them using the RCX. I would teach them about loops, triggers and sensors, motors, parallel behaviors. That would teach them those basics and give them hands on experience. For instance, the RCX allows easily to teach how robust robot software must be. Unlike pure software projects, mechanics, friction and unforeseen events tend to throw programs off.

Only when these basic skills are sufficiently mastered, and when precision matters to the robot behaviors, the time to come to use a NXT set. So initially, I’d have only a one or a few NXT sets for that purpose. Whereas they could experiment freely with the RCX, they must share the NXT on those advanced projects.

Over time, RCX units will wear out and are replaced with NXT units.

But will the RCX parts be around, and how about continued support? Here’s what Lego has already published on this topic:
  • Lego Education continues to provide [RCX] sets, software, technical support and services for Lego Mindstorms for Schools.
  • Tufts University’s Center for Engineering and Educational Outreach will play a key role in providing professional support and advice for new and existing [RCX] users.
  • The RCX motors, RCX sensors and Lego bricks can be reused with the new kit, so that you don’t need to throw away these parts. You can literally connect the old motors and sensors directly to the NXT brick.
  • If you have been using RoboLab in the past, you will find the new LabVIEW environment very familiar. Both products have been built by National Instruments, both products have started from the same underlying software (LabVIEW), and have a nearly identical philosophy.
  • The NXT kits will be available in August 2006.

Does it make sense to mix old Lego motors and sensors with the new Lego Mindstorms NXT? Absolutely! For instance, if you have a car-like robot, you could use a new motor for the steering wheel (precision), and an old motor to move forward (not so precise). Likewise, the difference between the old touch sensor and the new touch sensor is not phenomenal. Nevertheless, “touching” (or hitting) an obstacle is one of the most frequently used ways of detecting the environment.

In addition, I would never throw away the working RCX brick, since it can be used as the perfect slave computer for a NXT brick.

Finally, I hope that sites like bNXT and others will provide you with the answers that you are looking for when it comes to upgrading the RCX, doing the same things with NXT, or mixing parts. Don’t hesitate to ask them!

Version 3.0

In software, it is said that version 3.0 is usually the version that really gets it right. For instance, few people ever worked with Microsoft Windows 2.0. With Lego Mindstorms, we have seen
  • Lego Mindstorms
  • Lego Mindstorms 1.5
  • Lego Mindstorms 2.0
  • Lego Mindstorms NXT

I guess it fair to say that the NXT is version 3.0 for Lego Mindstorms.

Thursday, February 23, 2006

NXT Room Positioning System

It is often very useful for a robot to position itself in its environment. Animals and we use advanced vision and processing to accomplish this. These options are currently not open for Lego Mindstorms NXT robots.

However, GPS shows us that cars can position themselves with high accuracy without complex vision, by triangulating their position against known fixed positions (in the sky). But GPS doesn't have the accuracy needed for our robots, and it doesn't work indoors.

How could we create a Room Positioning System? In a past project, my team and I created something similar: a absolute tracking system. The robot shown in the image had to follow the person by tracking the position of the transmitter. The transmitter was worn by a person, and the project's objective was to drive a golf caddy over a golf court.

The robot used a sonar transmitter, and two sonar receivers. Sonar is based on ultrasound, which is sound. The speed of sound is a lot slower than the speed of light, and can be measured even at short distances. To calculate how long sound traveled, you need to know when it started flying, and when it arrived. That is why the black sending box sent out a radio signal and sonar signal at the same time. The radio wave (at the speed of light) was near the robot immediately, while the sonar reached it slightly later. That time difference provides a very good measure of the distance between the robot and the beacon.

Building on the previous concept, we could build an indoor position system by creating some sort of light house. The lighthouse is controlled by an NXT brick. The lighthouse sends out a sonar bliep, and a Bluetooth message at the same time. Since the NXT brick will not send them exactly at the same time, we need to measure the time it takes between sending the sonar signal and the Bluetooth, as corrective measure. Like a real lighthouse, a motor would rotate the sonar continuously. The Bluetooth message would contain the current rotational angle of the lighthouse. Because of this rotational information, the receiving robot needs only one sonar receiver instead of two.

The receiving robot would receive this information. By calculating the flight time of the sonar signal, it can measure the distance to the lighthouse. By using the angle encoded in the Bluetooth signal, also knows the direction it is currently on relative to the Lighthouse. Using polar coordinates, it has an absolute position where it is in the room.

To calculate the flight time, the robot must listen for both the Bluetooth message, and the sonar bliep. The robot will have to compensate for calculation times. Because the Bluetooth protocol is a multilayered protocol that takes time to calculate, the approach can gain a crucial amount of precision by timing to the low level interrupt that signals the arrival of the radio message, and using that timing if the message turns out to come from the lighthouse.

There are a number of complications, the main one being that sound (including sonar) bounces of walls, creating shadow reflections. Therefore, the Lighthouse must not signal to fast, for the reflection to die out. The robot must also take into account deadreckoning measurements to understand the likeliness of the signal. That implies that the lighthouse is used as a continuous callibration of deadreckoning. Instead of deadreckoning, a digital compass sensor could also be used.

NXT Mindstorms Retail vs. Educational Software

In a previous blog article, I discussed the difference between the retail and education version of the Lego Mindstorms NXT set on the hardware side, where the rechargeable battery, and the fact that the NXT Brick can run of a wall socket, appear to be the biggest differentiators.

The Lego Mindstorms Education site mentions that:
Bluetooth enables the NXT brick to communicate wirelessly to all devices with Bluetooth capabilities. Exclusive to the MINDSTORMS Education NXT software, Bluetooth also enables the computer to communicate to several NXT devices at the same time.
Oddly enough, this information is provided in the hardware section. It seems like the a pure software function to me. Besides that, it also does not make any sense to me that Lego would want to exclude this from the retail version. By leaving it in the retail version, they would stimulate people to buy a second set. Anyway, it is inevitable that this functionality, as well as Bluetooth mesh networking for NXT robots, will be created by Lego Mindstorms retail users, if it is not provided out of the box.

The Challenges, previously seen in pictures, are touted on the Education site as the "Robot Educator". It is unclear whether they will also be part of the retail version.

Lego appears to be pretty sure of its shipping date, since it no longer uses "fall 2006" as launch date, but explicitely publishes "August 2006". It also appears that the Educational version will be available at the same time as the Retail version (which makes sense: just before school starts).

Another quote from the Lego Education website, on the First Lego League:
FLL anticipates no game-related advantage or disadvantage to using either the new or the existing technology in the 2006 FLL Challenge. The 2006 FLL Challenge will be designed to support both the existing and new MINDSTORMS Education NXT technology. FLL is in the process of evaluating a migration plan to introduce the new technology into FLL Challenges in future years.
This is a surprising statement. Given that Lego itself writes that it will now be much easier to have robots drive straight, and control the robot in general, I am not sure how you could design a Challenge where the NXT robot has no advantage.

Finally, if you were thinking of registering for the First Lego League, the Education site indicates that now may be a good time. You will be offered additional bricks, on top of what is already in the Lego Mindstorms NXT for Schools.
This specially priced set is available exclusively to FLL teams through the FLL registration process. The FLL Robot Set will include the MINDSTORMS Education NXT base set plus a selection of additional building elements, an additional touch sensor, software, a rechargeable battery system, an FLL team site license, and a storage container. As with the existing registration process, teams may purchase one (1) FLL Robot Set per paid FLL team registration.
But I'm a bit confused by this statement. I thought the items mentioned were actually part of the Lego Mindstorms Education NXT set?

Wednesday, February 22, 2006

More detail on the Lego servo motors

The Lego Education site has some information on the new NXT servo motors. Especially the following image is quite interesting:

© Copyright Lego Education

UPDATE on February 23: A quick snapshot of a Lego Racer motor. These motors have more power than the standard Technic motors. Are the NXT motors more powerful too?


A brainopedia is something like a constructopedia, but for software.

Tradionally, when people exchange software, the software is ready made. That makes it very hard to learn from it. It is like someone hands you a complete (and complicated) Lego Technic vehicle, and asks you to build a second one. You have to start taking it apart, and it takes a long time for you to figure out why someone did things the way they are done. Using a constructopedia, where you have step-by-step instructions really explains the design.

In software, you also have step by step tutorials. Unfortunately, these usually address a simple problem, and then it is up to you to combine these into more complicated programs. It is like knowing how to use the Lego bricks, getting all the bricks, and now it is up to you to invent that Lego Technic vehicle. That is very complicated.

Lego Mindstorms NXT comes with powerful graphical development environment. I propose to store visual programs in a brainopedia, which starts the program with just a few instructions, and gradually expands the program. Unlike a constructopedia, it would be good to include lots of written descriptions of why you introduce the block, and how it relates to the hardware.

So, a brainopedia is like a prolonged tutorial that ends in a complex program.

Building on the previous articles in this blog on the Wiki-Constructopedia, it makes sense to allow anyone to augment the programs in the brainopedia, thereby creating a Wiki-Brainopedia. This is not only a great way to store your software (and design) for later use, it also brings insights to others.

Because you can see the robot move based on your instructions, I'm hoping a Wiki-Brainopedia is a great way to learn how to create software.

What do you think?

NXT Sports

Competitive sports are great fun. They bring people together, and push the limits of what you can do. For Lego, there is already the First Lego League. In that spirit, I wonder which "sports" could Lego Mindstorms NXT robots do. Off course, in all of these sports, only pure Lego parts, or NXT parts from third parties (especially third party sensors), are allowed. What sports was I thinking of?

Well, there is the obvious soccer game. I guess RoboCup has paved the way there.

Another cool candidate is robot racing. The Lego Mindstorms NXT have angular encoders on the motors, so you can drive them really accurate, and keep them on the race track. It has ultrasonic obstacle detection, so you see the other robots. How about a real race track (which is circular with some extra turns), with multiple robots that need to overtake each other like a real race? With a qualifying speed lap for pool position?

A very different kind of challenge might be a climbing/hiking sport, in which the robot must overcome very rugged terrain. There should probably be points for elegance, amount of ground contact (flying over it doesn't count), etceteras.

Finally, while not the most emotional sports, combat sports are always highly popular. Maybe Judo is a pretty clean sport. If you can turn your competitor on his back, or push him out of the ring, the jury gives you points. Sufficient points and you win. No non-Lego parts allowed!

What other sports do you think are cool? Or do you have changes to the ones I proposed?

UPDATE on February 23: Another robot sport already out there is Maze Running. Check out MicroMouse competition.

Tuesday, February 21, 2006

First 100 for MDP Chosen

Steve Hassenplug, one of the four original members of the MUP (Mindstorms User Panel), mentioned on LUGNET that the invitations for the first 100 MDP (Mindstorms Developer Program) have all been sent. So if you did not receive that invitation yet, you are not one of the selected people. You might still be on the backup list, in case any of the invited people chooses not to participate in the program.

How To: Use Bluetooth to Take Pictures & Drive a Robot

In the previous article, we introduced how the robot could interact with you via your Bluetooth phone. There are a number of other commands that may be useful when the robot controls the mobile phone. The commands presented here are based on the Sony Ericsson T630 mobile phone.

Using the Camera

If the phone has a camera, then you can take a picture by sending the command:


The first time you send this command, the phone will move into camera mode. The second time you send it, the picture will be taken. The third time you send the command, the picture will be stored in the phone's "My Pictures".

To get back from the camera mode to the main screen, use this command:


So, to take a picture, save it, and return to the front screen, your script would be to send the following as ASCII to the serial port:


Each command must be on a new line. Each command will return an "OK".

Showing a Message

If you just want to show a message on the screen of the phone, for instance as a debug message, then you can use the following command:

AT*EAID=1,0,"the text of your message goes here"

The command immediately returns "OK". When the user presses OK button, you'll receive the code "+EAII: 1,1" over the serial port. If the user presses the cancel key, then you'll receive the code "+EAII: 0".

Getting Direct Keyboard Feedback

To control a robot, it is really useful to be able to read the keyboard directly. Using the robot in the image, suppose you used the following keyboard mapping:


To start reading the keyboard directly, use the following command:


The command will immediately return "OK". For the rest, it will return the following code, where the k is the key you pressed, and p is 1 when you start pressing, and 0 when you release it. So when you start pressing 1, the serial port returns “+CKEV: 1,1”. As soon as you release the key, it returns "+CKEV: 1,0". Here’s the complete map of the keyboard:


+CKEV: R,p

+CKEV: <,p+CKEV: J,p+CKEV: >,p
+CKEV: v,p

+CKEV: c,p

+CKEV: 1,p

+CKEV: 2,p

+CKEV: 3,p

+CKEV: 4,p

+CKEV: 5,p

+CKEV: 6,p

+CKEV: 7,p

+CKEV: 8,p

+CKEV: 9,p

+CKEV: *,p

+CKEV: 0,p

+CKEV: #,p

You can press two keys at the same time, and both will be sent to the serial port.

To stop listening to the keyboard, use the command:


Putting It All Together

Finally, to demonstrate the above concepts, here is a flowchart that turns your mobile phone into a live remote control for your robot. This software runs entirely on the NXT robot, there is no programming required in your mobile phone.

This program results in the following screen on the phone:

And below you see the commands sent to the phone, and received back. As you can see, I first pressed '2' to go forward. Then, I stopped. Next, I went forward again, but this time, while keeping '2' pressed down, I also turned left by pressing '4'. The robot would now turn left while still going forward. I released the left key, which made to robot go forward again. Then, I release the forward key. Finally, I pressed the OK button, which terminated the program.

How To: Use Your Phone As NXT Remote Control

Lego Mindstorms NXT has Bluetooth on board. It is likely that Mindstorms uses the Bluetooth serial port emulation mode. To understand how this works, here is a demonstration that uses a regular PC instead of the Mindstorms NXT brick. We're not going to do any programming in this demo. In this demo, I will be using Microsoft Windows XP on a computer with Bluetooth, and a Sony Ericsson T630 mobile phone.

The proposed sample "application" does the following: from the computer, I'm going to ask the mobile phone to display following menu options on the screen:
  • Forward
  • Backward
  • Left
  • Right
  • Stop

After the user has made a selection, I'd like to know what that selection was (or if the menu was cancelled).

First, let's start the HyperTerminal. HyperTerminal is a program that allows you to communicate directly with the serial port. You can find this program on
Start > All Programs > Accessories > Communications > HyperTerminal

When you start HyperTerminal, you will see the following screen:

Initial HyperTerminal Screen

You can provide any name you like, and choose any icon. Then click "OK". This brings up the following screen:

Here, it is important to choose the right communication port. Do not choose the "Standard Modem over Bluetooth Link", since that will ask you for a phone number to dial into. Rather, selected the virtual COM port that Bluetooth is mapped to. This is usually COM7 or COM8. Just select the COM with the largest number for now. You can leave all other settings as they are. Speed doesn't matter for this demo.

As soon as the selection is made, HyperTerminal will connect to the serial port. It should say "Connected" in the bottom left of the window's status bar, and present you with a blank screen. Let's first check if you selected the right COM port. If you type in the command "AT+CGMI", the phone should return you its manufacturer. If it does not, they you probably need to select another COM port.

Click image to enlarge

Great! We have a live connection with the phone. Now, let's ask the phone to show that menu we wanted. Type in the command

AT*EASM="bNXT Remote", 0, 1, 5, "Forward", "Backward", "Left", "Right", "Stop", 1

Click image to enlarge

That number 5 in the command indicates the number of menu items you use. So if you change the menu options, change that number too. Now look at the screen of your mobile.

Yes, it is really that easy. Make a selection on the phone. In my case, I selected forward. The menu on the phone disappears, and on your computer screen, you see the serial port sent back the code "*EAMI: " followed by the index of the menu item selected.

Click image to enlarge


So in summary, when you are on the NXT Brick, all you need to do is send the AT*EASM command as ASCII over the Bluetooth serial port, and listen to the port. When you receive an ASCII string result that starts with "*EAMI: ", then the next character(s) contain(s) the selection made, encoded as the sequence number of the menu item. If you receive 0 as selection, then either the user cancelled the menu, or there was another menu already active.
When the robot is ready to receive another command, just send another menu to the phone.

Have fun!

Monday, February 20, 2006

Why Lego Mindstorms (bis)

Over on Jim's blog, in the comments, there was an interesting question on what has made Lego Mindstorms a success. I'd like to take that a step further, and say why I believe Lego Mindstorms NXT may be an even bigger hit than the old Mindstorms RCX (RIS). As you know, I am not affiliated with Lego in any way, so everything here are just my personal thoughts.

A bit of background. As you see in my about me, I was founder of Robonetics. We used to build all sorts of robots, many of them for the mass market. Contrary to what you might think, this was not our mission. Robonetics was founded as a robot software company, which fits my background as software engineer. Unfortunately, clients never come with a ready-made robot and ask to build software for it. It wouldn’t even be a good idea, because there is a close link between the shape of the body and the complexity of the control software. So we ended up building prototypes for commercial toy robots.

We first tried building the body and brain in Lego. This didn’t work well. The Lego Mindstorms RCX, with just 3 motors and 3 sensors, was too limited. Since it didn’t have servo motors, it required sensors just to control the position of the motors, which left next to no sensor inputs for the real work.

So we used the BasicStamp, in combination with HiTec servo motors and wooden/polymer bodies. This approach worked well enough to produce the desired results, but it was expensive in man hours. Moreover, there was no easy way to reposition the sensors to try something else. As a result, we had a full time mechanical engineer who did nothing but modify the body of the prototype robots, and keep them up and running. The good thing about using the BasicStamp is that we had all the sensors we needed: ultrasonic, infrared, light, tilt, … Most of these sensors were not available for Lego at the time.

For us, cost of the kit was not the issue. A solution that allowed building robots faster would have been great. A solution that allowed to software engineers to modify the body would have been even better. Lego is amazing because it can be put together very quickly, is easily changed without an engineering background, and yet the design does not fall apart easily. Even if the robot ran full force into the wall upon a sensor error. That’s why we later started to work our way back in the direction of Lego, by sticking our BasicStamp, servos and sensors on top of Lego Technic bricks. Unfortunately, our main customer was not very reliable, and has gone bankrupt since, and we were forced to close our doors.

As you can imagine, that didn’t make my passion for robotics go away. When Lego announced Mindstorms NXT, I was immediately swept off my feet. Here was the Lego kit that had all the things Robonetics was working toward. For instance, we used close loop angle sensing on the servo motors to measure its actual angle. To understand this, you need to realize that normal servo’s are fed a position and then you hope they achieve this position. There is no way to know whether they actually got there. On a model airplane, when you are moving the flaps, the motors are only working against the wind and so the only concern is the power of the motor versus the power of the wind. But when you start building walking robots, obstacles blocking the legs are a real issue. That’s why it is really important to know what angle the motor actually achieved.

Close loop motors also allow servo’s to run slower. The way to achieve this to send the motor to angle 1°, then to angle 2°, and so forth, at the pace you like the motor to turn. The new Lego Mindstorms NXT has closed loop motor control right out of the box. That is really a big help when building robots. Plus, it leaves the four sensor ports wide open for real sensing.

The new Lego Mindstorms NXT also had an ultrasonic (US) range finder right out of the box. US sensors are a great thing when building robots. They are like eyes in the sense that they detect distances to obstacles, but they are very easy to process. US sensors have poor angular resolution, but with some clever mechanical/software tricks, you can make a really high resolution map of the world in front of the robot. I'll write about that sometime, maybe when I get my hands on the actual Lego sensors?

But it’s also the little things that got me exited about Lego Mindstorms NXT. An ultrasonic range finder doesn’t work on very distances. For that, you need a light sensor. The light of the built-in LED reflects on surfaces. If there is a lot of light, then there is an obstacle, otherwise, the obstacle is further away or not there. By turning the light sensor downward, you can detect if the table “obstacle” is there. If you stop detecting the table, and you don’t want to drop off the table, you best stop or reverse the robot! The same light sensor can be used to follow a dark line on paper, because light reflects better on white paper than on the dark line. All you have to do is keep your robot where the light is not very strong.

The little thing I was referring to is that with the Lego light sensor, you can also switch off the LED. That is cool. Here’s how you’d use it: when our old Gupi toy robot got scared from loud sounds, it ran for the closest dark spot (e.g. under the sofa). After a while, it gently came back toward the light, cautiously leaving its safe spot under the sofa. Lego Mindstorms NXT not only has the right light sensor for the job, it also has the sound sensor, and can distinguish between loud and gentle sounds.

At the time, a different product was going to be able to communicate with other robots over the Internet. Again, Lego Mindstorms NXT is perfect because using its wireless Bluetooth, we can achieve this easily via a PC-connection.

The Bluetooth also allows using unlimited processing power. If the processor onboard is not powerful enough, run the software on a nearby PC and send the instructions to the robot for execution. Bluetooth also provides a great way to debug the robot by seeing on the PC screen what the robot sees, and to remote control it to test sensors.

I guess I could go on, but the essence of what I am saying, is that we could actually build every single research robot we’ve built at Robonetics, both toys and real-duty robots, with the Lego part of Mindstorms NXT, especially when you factor in all the parts from other Lego Technic sets, the parts from third parties like HiTechnic and PC-based control via Bluetooth. Lego Mindstorms NXT is more than a toy, or an educational kit. It is, in my opinion, the easiest to use and most powerful kit to build advanced robots. And any parts missing today, like a tilt sensor or infrared sensor, will undoubtedly be available as a plug-and-play brick within a year after the launch of Mindstorms NXT. But that's just my guess.

The most amazing thing of it all is that both kids and adults will understand this set. They will be able to play and build these robots themselves. And with the help of libraries I hope to help provide, they may build really advanced robots. Maybe, one day in math class, they may realize that trigonometry isn’t as useless as it first seemed to them.

No Extendible Constructopedia Inside LabVIEW?

In a number of recent posts, I introduced the idea of the Wiki-Constructopedia. I also wondered if there was a constructopedia inside the NXT LabVIEW environment. I believe the Lego Mindstorms education site my provide an answer to that question. It says:
The software includes a Robot Educator; a step-by-step guide to
programming, and will be available in US English.
This sounds to me like you cannot add your own inventions. I would like to investigate whether it is possible to deliver content from the bNXT site (the Wiki-Constructopedia, but perhaps also other content like "how-to" pages) inside the LabVIEW environment.

Mindstorms Education

UPDATED on February 21.

More information on the difference between the retail and educational version of Lego Mindstorms NXT is now available at

Here are the key differences mentioned:
  • Rechargeable batteries. These will only be available to users of Lego Education. The Lego Education blog says

    The 1400 mAh lithium battery more than replaces AA batteries that run down quickly and cost so much to replace – it has a minimum capacity of 670% of 6 AA batteries (although you can still use AA batteries in a pinch). It doesn’t take long to recharge, either. Only 4 hours are required to charge the battery from zero to full. And, since it’s a lithium battery, you can partially charge it or leave it charging overnight without having to worry about any negative effects. There’s also an A/C plug in the battery to allow the NXT brick to run from a direct power supply when needed.

  • Instructions and curriculum in languages other than English in 2007.
  • CD-ROMs with 30-hour introduction to robotics engineering, 45-hours robotics project program and 15-hour guided research experiment.
  • Sets cater for 2-3 students, although it is unclear what that actually means.
  • Sturdy storage boxes for the parts with sorting trays.
  • Options to buy additional NXT bricks and sensors. I'm guessing this will also be available for retail versions, but the packinging and pricing may be different.
  • Converter cables out of the box, to connect legacy motors and sensors to the new Lego Mindstorms NXT brick. I believe these will be available as separate purchase for retail.

It is also interesting that they minimize the difference between the current RoboLab and the new LabView software.

Saturday, February 18, 2006

NXT Expansion Ports

When Lego first announced the NXT brick, I was pretty excited about the servo-like motors, the more capable sensors, the Bluetooth wireless link and the new software development environment. And until very recently, I thought the NXT was an improvement on the RCX brick, and I expected similar developments. But I may have missed the bigger picture. The NXT isn’t just a more powerful version of the RCX brick. It is much more than that.

The thing I did not immediately get, is that on the NXT brick, the “sensor port” is much more than its name suggests. It would probably be more appropriate to call it an “expansion port”. Although I haven’t seen any evidence that the “motor ports” can also be used as (slightly different) expansion ports, it is likely that this is the case.

That means you could think of the NXT as a tiny computer with seven USB-like ports to add more devices. Off course, the sensor port has a much simpler protocol than USB. The benefit of that is that it is easier for third parties to create compatible electronics. The drawback is that the sensor port does not have true plug-and-play. Still, Lego probably made the right choice here. The ability to have a large number of third party components will add most value to Mindstorms NXT. It will also keep the complexity of the “operating system”, and hence the load on the processor, low.

Why are expansion ports such a big deal? Because third party components were essential to the success of the personal computer (PC). Once you give the market the freedom to innovate, they’ll take the product through innovation cycles that take it to a whole new level.

Already, we see that the HiTechnic multiplexer has an onboard processor to service 8 additional ports, and map them on a single NXT port. In essence, the multiplexer is a co-processor for the NXT brick that handles I/O. We can expect more co-processors to take away tasks from the central NXT brick processor. The central processor will be in a coordinating role, making everything work together.

Here's a perhaps less obvious example. The NXT Brick has onboard Flash memory. How much memory the NXT brick has, is not public yet. But whatever it is, people will want more. Expect third party flash modules that plug into a sensor port in similar ways like an USB memory stick plugs into your computer (but without the plug-and-play aspects).

Looking from this perspective, it is also clear that the new shape of the ports is much better suited for its digital task as expansion port, than the old style RCX connectors.

Friday, February 17, 2006

NXT to RCX Communications (and Back)

The guys over at HiTechnic are certainly keeping busy these days. Today, Steve Barker from HiTechnic told Jim and me that they are working on a new product which they call the HiTechnic Bridge.

The purpose of this new product is to enable communications between the legacy Mindstorms RCX and the new Mindstorms NXT.

Lego Mindstorms NXT versus RCX
The new Lego Mindstorms NXT next to the legacy Lego Mindstorms RCX.
Pictures of the HiTechnic Bridge will be available at
the official announcement of the product next week.

The new Mindstorms NXT has wireless Bluetooth capabilities to talk to many other devices. The legacy Mindstorms RCX communicates only using its infrared port, and Lego has decided not to include the infrared port on the NXT. On the forums and blogs, proposals have been made to solve this problem. Since both the RCX and the NXT can talk to the PC, the idea in most of these proposals is to have the PC relay the messages between the NXT and the RCX.

Lego IR towers
Two versions of the legacy Mindstorms RCX IR Tower that connect to the PC.

The PC-as-middleman is a great solution when the RCX and NXT are not on the same robot. However, if you want to combine the RCX and NXT on the same robot, things get a little messy. Because Bluetooth is based on radio waves, the NXT brick does not need to keep in line-of-sight with the PC it is communicating with. This provides it with great mobility options. However, the RCX needs to point its infrared transmitter/receiver at the IR tower which usually is right next to the PC. By combining the RCX and NXT on the same robot, you must again point the RCX (and the entire robot) to the PC. This is undoing the benefit of the Bluetooth connection, and as a result, it is quite likely that you will prefer not to use the RCX Brick anymore.

The new product that HiTechnic will announce in a couple of days provides a simple and elegant solution to this problem: the HiTechnic Bridge contains an infrared (IR) transmitter and receiver, and is controlled using a NXT Brick sensor port. Instead of connecting the IR Tower to the PC, the Bridge is essentially an onboard “IR Tower” that you can connect directly to the NXT Brick.

The PC can communicate wireless via Bluetooth to the NXT brick, and the NXT brick can send commands to the RCX using the Bridge, without keeping line of sight to the PC. The HiTechnic Bridge turns the legacy RCX brick in a perfect slave computer, without sacrificing the new freedom that comes with the NXT brick.

Keep in mind that to program the RCX, you will still have to use the old RCX software. There is no software compatibility between the RCX and the NXT brick, and the HiTechnic Bridge cannot resolve that. However, it is possible to stop programming in the old RCX environment, and still use the RCX as a slave computer. Simply run software on the RCX that takes commands from the IR port, and drives the motors with them, and returns all sensor values to the IR port. That single program should be able to serve all your future needs. You can stop programming the RCX and let the NXT do the thinking.

The HiTechnic Bridge has full bi-directional data transfer. Either the NXT or the RCX can initiate the communication, depending on how you program your robot. The HiTechnic Bridge should be available by the time Lego Mindstorms NXT launches in the fall of this year.

Wiki-Constructopedia: Personal RSS Feeds

The Wiki-Constructopedia can be taken a step further. As you can see on my site, I play a lot with RSS feeds. That's why I thought it would be a good thing to create a RSS feed that notified the users of new or updated entries in the constructopedia.

But then I thought that this wasn't perfect. Do you really want to get notifications for robots that are too easy or too complicated for you? Do you want to get notified if there is a new robot for which you don't have the parts? Sometimes, the answer may be yes, but usually, the answer is going to be no.

That's why I believe it should be possible to make the RSS feed tailored. Everyone should be able to specify which robots should be in her/his feed. The best way to select these robots is probably using the search parameters we discussed yesterday.

Users who are logged in should be able to specify a "RSS search". Every time the Wiki-Constructopedia is changed, everyone's RSS search is re-evaluated (albeit sometimes with a delay to balance the load), and the result is placed in your personal RSS feed (most recent updates first). Then, the only thing you have to do is to subscribe to your own personal RSS feed.

I thought a bit about implementation issues and expected load on the server. I believe there are some clever processing optimizations possible that make such a personal RSS possible for everyone.

As always, this is a request for comment. Do you have ideas to make personal RSS feeds even better?

Control 19 Motors and 16 Sensors

The NXT Brick has 3 motor ports and 4 sensor ports. The NXT box comes with a sound sensor, a light sensor, a touch sensor, and an ultrasonic sensor, plus three motors. So out of the box, all of the brick ports are filled.

© Lego. All NXT Brick ports are filled with sensors and motors.

The “old” Lego Mindstorms RIS also had a limited number of ports. However, the sensors that connect to Mindstorms RIS are analog. By using some clever tricks, two analog sensors could share a single Mindstorms sensor port. This method allowed only a few extra sensors, no extra motors, and also required non-trivial programming. The Lego Mindstorms NXT comes with digital ports, but analog to digital cables will be available from Lego. That means you could in theory combine some legacy sensors, but not the new NXT sensors.

However, Lego Mindstorms NXT has a solution that is a lot simpler, and a lot more powerful! By the time Lego Mindstorms NXT will be available, HiTechnic will launch a multiplexer on the market. A multiplexer is a device a lot like the USB hub you may have: plug all your USB cables in the hub, and plug the hub in a single PC USB slot. HiTechnic introduces the same concept for Lego Mindstorms NXT motors and sensors. You can plug up to four motors, and up to four sensors, into their multiplexer, and plug the multiplexer in a single NXT Brick sensor port. So by giving up one sensor port, you win 8 additional ports. According to HiTechnic, each of the four added sensor ports will support both passive and active legacy (analog) sensors, including the “old” rotation sensor, as well as the new NXT sensors. In the four additional motor ports, you can connect both the smart NXT motors with position feedback, and the “legacy” Lego Technics motors you have used till now.

© HiTechnic. A prototype of the Hitechnic multiplexer.
The final casework will have Lego Technic compatible holes.

What if you want even more motors? Well, every NXT Brick sensor port can connect to a HiTechnic multiplexer. That means you can convert your 4 standard sensor ports into 16 motor ports and 16 sensor ports. The standard 3 motor ports are off course still available. Each of the added ports works just like a standard NXT port. Amazing!

For those rare cases that you need more than 16 sensors and 19 motors in a single robot, you may wonder if you could connect a HiTechnic multiplexer in one of the added sensor ports (daisy chaining in electronics speak). Although this may be possible in the future, the initial version does not support this feature. There are probably few robots that need this feature anyway. But if you do, an alternative solution is to add another NXT brick and combine them using the Bluetooth wireless link.

So how about speed? Is a NXT Brick sensor port fast enough to control 8 added ports? Won’t the values of the various sensor mix in annoying ways? To address these issues, the multiplexer has an internal processor. For every added sensor and every motor port, the multiplexer has an up-to-date sensor buffer of the sensor values and motor position measurements. Every time the NXT brick does a read on the original sensor port, one of these values is passed. According to HiTechnic, for most applications, there should be no noticeable difference from using the original NXT ports.

© HiTechnic. A look under the hood of the HiTechnic multiplexer.
A number of chips doing some fancy processing can be seen.

Notice that the multiplexer is still under development, and all the information presented here may change before the device is launched.

UPDATE: There is more information on The NXT Step blog about the multiplexer.

UPDATE 2: It is probably more appropriate to compare the multiplexer to a router, like the one you may use to connect multiple home computers on a single broadband connector, or to connect game computers together in a local network. The difference is in the complexity of smart signal routing.

Thursday, February 16, 2006

Wiki-Constructopedia: Search

UPDATED on February 17.

Since there is no news to report on the Lego Mindstorms Development Program, let's continue to investigate how a Wiki-Constructopedia should work. Finding the right robot within the Wiki-Constructopedia is an important issue. In this article, I will explore the ideal “Search” capabilities, based on the information I currently envision the Wiki-Constructopedia to contain.

Base Information

But first, we need to define what information a robot submission should contain. I'm assuming here that the author is already logged in, and has chosen to either create a new robot, or to branch off at a particular point of an existing robot. Then following information seems right:

Mandatory information per robot:

  • Title for the robot
  • Complexity
    • Possibly adjusted by community if over-/underrated
    • This represents is the skill required to build the robot from the step instructions, not the skill required to invent the robot
    • Jim and I (see comments) propose following options:
      1. Beginner
      2. Experienced
      3. Expert
      4. Master
  • Category. One of the following Lego categories:
    • Vehicles
    • Machines
    • Animals
    • Humans

Optional information per robot:

  • Description. Possibly revised by community if English is hard to read.
  • Tags. One or more tags you want to associate with the robot.
  • List of links to software that runs on this robot.

Mandatory information per step:

  • Image of the step. Either a picture taken with your camera, or advanced users can submit an LDraw image.
  • List of parts used
    • Selected off a list
    • It’s probably a good idea to restrict the number of part choices on the input screen by selecting the Lego boxes you actually have.

Using this information, we can define the following searches.

Simple Search:

  • Keyword in title or description. Full text search of title for given word list. Use the minus sign to exclude words.
  • Complexity. Select one or more complexity ratings.

Advanced Search:

  • Everything from Simple Search.
  • Category. You can specify one or more of the four Lego categories.
  • Use only parts or boxes.
    • A list of individual parts and Lego boxes that the search must restrict to. That way, you only see the robots that you can actually build.
    • Robots that do not use all parts will also be selected (since you can always use less parts than you actually have).
  • Must use parts.
    • A list of parts that the robot must use. Here, it makes no sense to do "must use boxes", because when do you use a box? When you use 1 part of the box? When you use all parts of the box? For boxes, it is better to restrict your search using "use only parts or boxes".
    • The minus sign can be used to forbid using a particular part.
  • Author. An list of authors that must (or may not, when using minus sign) have collaborated on this robot, either by making changes to its construction, or by creating the robot in the first place.
  • Tags. A list of tags that must (or may not) be associated with the robot found.
  • Changed since. The robot must have been changed more recently than the provided date. Useful to find new robots.

I've also been wondering if you shouldn't be able to specify once and for all in your personal information page which Lego boxes and parts you have, so that you can automatically restrict even simple searches to those parts by selecting a tick box.

This is off course a request for comments...

Wednesday, February 15, 2006

Number of Applications for Developer Program

Jake McKee, Community Liaison for the Lego Community Team, mentioned there have been thousands of applications for the Lego Mindstorms NXT Developer Program!

Constructopedia Inside LabVIEW

Apparently, there is a Constructopedia for at least a number of challenges inside the LabView environment itself.

It is unclear right now how web-driven it is, and if you can make your own robot designs available to a wide public.

More on NXT Software

Robert Morton, a former National Instruments employee, who used to work on the Lego compiler for Mindstorms NXT, wrote on Slashdot about the compiler and runtime of the NXT brick.

Here are the key points that he adds:
  • He called the runtime on the brick a virtual machine. This implies that there is an intermediate language that runs on the brick, if the name is used correctly.
  • The Labview environment compiles to that intermediate language, if the interpretation is correct.
  • Lego wants third parties to augment the software environment (to support new hardware). That collaborative spirit was also in earlier interviews.
  • The new runtime on the brick is better suited for C-style languages than the RIS 2.0 one.
  • The new runtime is oriented on highly parallel dataflow programming (extending the RIS approach). This makes a lot of sense to me.
  • The compiler itself was written in LabVIEW.
  • You could use the LabVIEW version that is delivered with Lego Mindstorms NXT to extend Mindstorms (and its compiler) with new functionality.
  • However, his best guess is that much of the API used by the compiler won't be initially available to everyone, because the release time schedule of Mindstorms.
  • On the other hand, he thinks it is only a matter of time before an SDK is available.
  • Within National Instruments, there have been informal discussions about open-sourcing the Mindstorms NXT compiler.

I wish I could start experimenting with Lego Mindstorms NXT.

Tuesday, February 14, 2006

Lego Biology: the Wiki-Constructopedia

I propose to build a wiki-constructopedia in the fun zone of this site. The wiki-constructopedia is a place where people can collaborate on building Lego Mindstorms NXT robots. The wiki-constructopedia is focused on the body of the robot. Software support will be added later.

Why Wiki?

You may have built a really great robot that you’d like to share with others. A constructopedia allows you to store step-by-step instructions for yourself and others to build the robot again later.

Later, when you see a robot design created by yourself or by someone else, you may find that there are things that can be improved. Maybe changing the placement of some parts makes the robot more robust, or more versatile. Or maybe you’d just like to add additional features to the robot. Today, doing this requires starting over with the building instructions. Wouldn’t it be great if you could have a discussion on a design, much like is currently done on Wikipedia. To be able to insert new steps, remove steps, or edit existing steps.

Lego Biology

At Wikipedia, truth is the ultimate measure. All pages are evolving toward the most accurate current understanding of the topic discussed. For a constructopedia, there is no such “ideal” that the robot is evolving towards. Much like software in the open source community, the features of the robot are always evolving. But unlike software, installing more features requires more (or special) Lego bricks. More complicated robots are not always the best robots.

At other times, you would like to take an existing Lego chassis, and evolve it into a completely different robot. Obviously, you are not just adjusting the existing robot, so you don't want to replace the existing instructions. So should you start from scratch for your robot?

I believe you should be able to create a new robot line by branching off an existing robot at a particular point. This leads to a family tree of robots. Anybody browsing the wiki-constructopedia, should be able to see the completed image of base robots, and their decedents. You could follow the evolution of the robots (in biology, this is called a taxonomy). You choose the robot with the look, functions and complexity that you like, and by clicking on the image, you go to the building instructions for that particular robot.

Each robot design should also be classified in one of the four Lego Mindstorms NXT categories: vehicles, machines, animals or humans.

Over time, some robot designs will used less frequent, or even go extinct. This will happen when the parts are no longer part of standard boxes, or ultimately no longer made by Lego. But by the time this happens, it is likely that those robot designs will have evolved into new robot designs that can be built with new parts that Lego has made.

Easy to Use

The aim is enabling 12-year olds from around the world to contribute to the wiki-constructopedia. So it should be really easy to use. This has a few implications.

First of all, there are language problems. It cannot be expected that 12-year olds around the world are capable of reading and writing English. On the other hand, it appears to be very complicated to translate everything to many languages. Therefore, to submit a robot, no text writing should be required. So the robot is just a series of images on how to build the robot. In the comment/discussion pages, for now, English will remain the main language.

Second, 12-year olds will not create the nice images that we all know and love from the Lego manuals. I know there are some great software tools out there to create such images, but using them is still too complex for 12-year olds. Rather, I’m going to assume that the 12-year old can use a camera. Maybe (s)he has a webcam, or a mobile phone camera, or mom/dad helps him/her out with the family camera. When the robot is finished, (s)he takes a picture. Then, (s)he breaks away one piece, and takes another picture. When the robot is completely disassembled, a series of images has been made (in reverse) that shows how to build the robot. Uploading these images is an easy way to describe a new robot.

I’m thinking of having people use photo hosting services such as Flickr. So, I would only store the URL to the image, not the image itself. This should seriously reduce the complexity of building the wiki-constructopedia. Flickr is also easy to use, and allows you to select the photo of the right size and copy the link to it.

It would also be nice if the robot builder could note per image which parts were used, by selecting them from a visual list. Even if the photo of the step isn't perfect, you know at least which parts you are supposed to use. At the start of the instruction, the wiki-constructopedia could show you a list of all the parts you’ll need. I would also add hyperlinks from the part to the step where the part is used. If you don’t have a part, you can see that step and evaluate if you can find a way around that step. Keeping track of which robots use which parts may also lead to interesting statistics. By looking at which parts are used most often, people may find it easier deciding which Lego boxes to buy to expand their Lego Mindstorms NXT set.

Anti-Spam, Anti-Vandalism

To avoid spam, I intend to require people to log in to change a page. The wiki-constructopedia will also keep automatic track of the history of an entry. The community will be able to restore an old version if it was falsely overwritten.


There is a many-to-many relation between robots and software:
  • the same robot may run multiple programs, each with different functionality, or different programs with increasingly complex software (novice versus expert), and
  • some software may work on more than one robot.
It is probably best to keep physical robots and their software separate, and to have links between them in both directions. So, for the wiki-constructopedia, software is represented as a set of links to the brainopedia. I haven’t dreamed up the requirements for the brainopedia yet. I image it will be hard to do so without working with the development environment. Right now, it is not entirely clear what the best format is to share software between fellow robot builders.


Off course, if Lego is planning something along the same lines, then there is no point in me building it. I will also be happy to help Lego with ideas on building the wiki-constructopedia concept on their own. But for now, please don’t hesitate to leave me comments on the wiki-constructopedia. Getting the requirements right before I get going helps a lot in the long run.

Monday, February 13, 2006

Feature Request

The new compass sensor from Hitech got me thinking about a robot that could navigate back to its home. This would be really good if the robot "is tired" and "needs to sleep", i.e. when its batteries are almost empty. However, I haven't seen any mention of a sensor input on measuring the battery level. It is likely that the battery level is measured in some way by the electronics already. If that is the case, it would be nice to make the current battery level available inside the NXT brick as another (internal) sensor.

In the absense of the sensor, I guess I'll need to use elapsed time to estimate when the battery will be dead. Unfortunately, that measurement is really imprecise since the amount of energy used depends on how many times the motor accelerates. With all the sensors that make the robot make clever evasive motions, there's really no way of tell how much energy was used (other than taking the worst case energy usage).

So if there is any way, even if it is only available to expert programmers that get to the low level registers, to allow the power to be measured inside the NXT brick, that would be great. It won't take long to write a software library that simplifies its use...

New Compass sensor, and sensor multiplexing

More exciting news, previously picked up by Jim: HiTechnic announces a NXT compatible compass sensor. The compass is more than accurate enough for Lego creatures: it has a 0,5 degree error margin. The sensor is plug and play, and programs using it should be really easy to build: the sensor simply returns a value from 0 to 359 degrees. Since the compass sensor can send back a value between 0 and 359, the sensor input on the NXT must be (at least) 16-bit. On the RCX, it was only 8-bit, and the compass sensor only had an accuracy of 3,6 degrees.

© HiTechnic. HiTechnic's Existing RCX Compass Sensor

HiTechnic is not just announcing the new sensor, they have it working and are going to distribute it to a number of people that are selected by Lego for their Mindstorms Developer's Program, starting in February. Well, since Lego will be taking February for their own decision process, I guess the first sensors will be shipped in March. That's amazingly fast! I'm really looking forward to how I can create smart behaviors using this new sensor. Gupi certainly can benefit a lot from it.

Lego Mindstorms NXT isn't out yet, but robot designs already come with tough choices. There is the touch sensor, the ultrasound sensor, the light sensor and the sound sensor. And now, there's also a compass. All of these sensors help a Lego creature to get around in the world. But unfortunately, there are only four sensor connectors. Putting the compass in, means taking some other sensor out. But I want them all! It would be nice if someone built a hub (multiplexer) for Lego sensors.
  • For touch sensors, multiple sensors could be combined into a single digital signal where each bit represents the state of the touch sensor.
  • Some other sensors need to be read less frequently. For instance, there is no harm in reading the compass slightly slower. If the light sensor is used to identify the color of the ball, it is probably acceptable to have a small delay as well. Using this principle, it may be possible for multiple sensors to do "time-sharing" on a single sensor port, essentially cycling through the sensors and feeding back their values one by one, likely with a sequence start special indicator value.
  • A third possible way to create a hub is by using the motor output to select the sensor used, and the motor position feedback channel to provide sensor data. I'm not sure how feasible that last option is. Even if it is, I'd prefer not to occupy motor ports for sensor reading.

Either way, it is really encouraging the HiTechnic is bringing out this sensor for NXT. A compass is now available with no soldering whatsoever. The compass should make it a lot easier to create Lego creatures capable of returning home.

Waiting for New Mail: Mindstorms Developer's Program

Yesterday, Lego announced that it will contact everyone who applied for the Mindstorms by the end of February. Just two more weeks of waiting until we know whether we've been selected. I'm sure hoping to be one of the lucky ones!

Wednesday, February 01, 2006

NXT Gaming

Yesterday, I wrote about the desirability of an NXT marketplace, from a commercial point of view. Today, I’d like to come back to that point, but looking at it from an educational point of view.

Lego is replacing the old Lego “dumb” motors in the Mindstorms RIS set with new Lego “smart” motors in the Mindstorms NXT set. The smart motors encode their rotation to an accuracy of 1 degree, which allows the NXT controller to move the motor to a specific angle, or count the amount of rotation. At least, that’s how I currently understand the motors to work, based on the bits of information available.

This change to smart motors is a big deal. Not because more complex robots can be built with it: electronic engineers could make motors do smart things before. But because complex robots can be built easily. With NXT, having a robot wave its arm or turn its head back and forth is child’s play.

I believe the same thing should happen when it comes to NXT software. As part of Mindstorms NXT, Lego will be providing a new development environment based on LabView. This new environment makes it easy to create new software. But it can only go so far.

For instance, every driving robot can benefit from the concept of “deadreckoning”. Deadreckoning essentially determines the position of the robot by counting wheel rotations. However, the formulas of deadreckoning are certainly not child’s play. They have to take into account wheel slippage in curves, and involve lots of trigonometry. On the other hand, a twelve-year-old could do deadreckoning easily if she had a pre-built component “deadreckoning” in her programming environment. The component is essentially talking the rotational sensor, and adding computed functionality to it.

Just about every sensor can be expanded to deliver a lot more information by using advanced mathematics and science. A child playing with the Lego set will be stimulated in his creativity and his exploration by using these libraries.

But the concept only gets started with basic sensor libraries. Building advanced robot control systems is more than putting basic capabilities together. Architecture of advanced robot intelligence can be daunting, and is certainly beyond the level of a twelve year old. Providing ready-made advanced robot games will teach the child a lot about what more can be done. Kids like to imitate, and they will certainly start to explore how a robot manages to achieve particular abilities. Plus, a good robot game should allow the kid to customize it, and add to it. It should be fun to see how kids tweak advanced Lego robots to make them better or more personal.

NXT Games are really just building on above concept. By selling the NXT Games, more time and effort can be put into creating them. Hopefully, this results in astonishing levels of competency and interactivity for NXT robots. This, I believe, will result in improved educational value for children, as well as in improved revenue for Lego.