LEGO MINDSTORMS RCX - Robotics Inventions System
This topic provides information about getting up and running using Microsoft Robotics Studio with LEGO MINDSTORMS RCX.
What to expect when installing the LEGO RIS 2.0 software
The LEGO RIS 2.0 software on the CD that comes with the LEGO kit will install and run on Windows 98, Windows ME, and Windows XP. It may install on other Windows versions, but there is no support by LEGO and, according to some discussion forum threads, the software is very likely to crash. We strongly recommend using only a version of Windows XP for programming LEGO MINDSTORMS RCX using Microsoft Robotics Studio.
After installing the software from the LEGO RIS 2.0 CD onto your computer, you will likely need to install one (possibly two) software patches from LEGO:
For all XP systems, there is a bug that starts the RIS Software each time the PC system is restarted. Download RIS20XPPatch.exe from the LEGO web site and install the patch following their instructions.
For PCs using Hyper-Threading (HT), you will need to install an updated IR tower driver to prevent system lockups. This patch file is also found on the LEGO web site. Download and save the Tower164 patch, double-click it, then follow the on-screen instructions to finalize the patch installation. It is also recommended you install it if the PC has a dual-core CPU.
Some dual-core systems have issues running the LEGO software even after this patch has been installed.
What should I expect the first time I run the LEGO RIS 2.0 software?
First plug the LEGO infrared (IR) tower into a USB port. The hardware wizard should detect the device and install it automatically using default selections. (NOTE The hardware wizard needs to run every time you connect the IR tower to the PC.)
Next, make sure your speaker volume is turned up so you can follow the directions given when the application is running. Start the LEGO RIS 2.0 Software from the desktop shortcut or from the Programs menu. The first time you run the program, select the top menu option, Run.
|During installation, this software takes control of your screen and you will not be able to switch between other running programs. You will be guided through the setup of the IR tower, the downloading of the LEGO RCX firmware via the IR tower to the RCX brick, and the testing of the effective range of communication between the IR tower and the RCX brick. Once finished, you can exit the program. The Constructopedia booklet included with the LEGO kit contains additional information about this on page 4.|
PLEASE NOTE THE FOLLOWING:
- Do not run other applications while performing the download of firmware (basically, the LEGO operating system) to the RCX brick.
- It is not unusual for it to take several download attempts before the firmware successfully transfers to the RCX brick. Three or four attempts before succeeding is also not unusual.
- The download of the firmware takes approximately four minutes. During that time, you should see a faint flashing green light coming from the IR tower and a counter on the face of the RCX brick going from 0000 to 2500. If the download fails you will be given the opportunity to retry.
- After completing the download of the firmware, the LEGO program downloads five proprietary sample applications to the RCX brick. This takes approximately one minute. The counter on the face of the RCX brick will go from 1 to 5 as the sample applications are downloaded. If the download fails, you will be given the opportunity to retry.
- If the batteries drain too low or you must remove the batteries from the RCX brick, it will be necessary to re-download the firmware.
Where do I get the software needed to program the RIS 2.0?
If you have not done so already, please download and install a copy of Visual Studio Express 2005 Edition onto your Microsoft Windows XP computer. Installing Visual Studio also ensures you have Microsoft .NET 2.0 installed as well.
Why Windows XP? The RIS 2.0 system was originally designed for Windows 98. Although it has support for Windows XP, it does not work well with Windows 2000 or Windows 2003 Server. Additionally, Microsoft Robotics Studio requires .NET 2.0, which generally requires more hardware horsepower than found on most Windows 98 and Windows ME computers. We therefore recommend sticking with a version of Windows XP for your MINDSTORMS RIS 2.0 coding projects.
Next, you need to install the LEGO MINDSTORMS RCX Software Development Kit (SDK) 2.5. This can be downloaded for free from LEGO.
Once the MINDSTORMS SDK is installed and you turn on the RCX brick, you should be able to begin using the Microsoft Robotics Studio tutorials. The tutorials require a special configuration file that describes the way you have sensors and motors connected to the RCX brick. For further information about this file, refer to the tutorial instructions.
Tips for setting up LEGO software and Microsoft Robotics Studio for LEGO MINDSTORMS RCX
The following is intended to provide some realistic expectations for what can be accomplished with this release of the Microsoft Robotics Studio for LEGO MINDSTORMS.
There are some known issues to be aware of:
- Some newer computers will not recognize the LEGO IR tower. For example, we have been unable to install the IR tower driver on a Toshiba Protege 3500 Tablet PC. A similar problem has been mentioned on some web forums for certain Dell desktop models, but we do not have a list of model numbers.
- Postings on several different forums related to LEGO MINDSTORMS RIS 2.0 have indicated a problem getting the LEGO software to communicate with the IR tower on some PCs with dual-core processors. Use of the Tower164.exe patch discussed earlier does not address this problem directly, but there are unconfirmed reports that it has, in some cases, resolved the issue.
- Changing the batteries in the RCX brick or letting the RCX brick sit for long times between uses can require the re-download of the LEGO firmware by starting the LEGO RIS 2.0 software, selecting the Settings menu option, and then selecting Download Firmware. If you are prompted for a password, simply enter your name and press enter.
The challenges of infrared-based communication ("tethered")
Because your code is running on the PC, think of LEGO IR tower as a wireless tether (a lifeline) between the PC running your application and the RCX brick that must execute physical actions based on those instructions. The IR tower is what makes this possible. If the communications link with the tower breaks at either end, the execution of your program stops.
Because the RCX brick is a very simple computer compared to your PC, you need to keep in mind its limitations when developing your code. For example, the RCX brick does not raise events. The IR tower must poll the brick for changes in hardware state and the information gathered must then be interpreted by your Microsoft Robotics Studio program as being an event that needs to be handled or not. Likewise, the tower using the relatively slow infrared signals form of communication may experience backlogs in instructions to the brick from the computer. In some test application development we noted the following issues may arise:
- Communications latency.
There may be a several second delay between when an event occurs on the RCX brick and when it is recognized by the PC. Long delays can cause an event to be lost altogether. Limiting situations and circumstances that can cause tower interference can be important in these cases, such as: preventing direct sunlight from shining onto the tower, keeping the robot within a reasonable range of the tower (about 8'-10'), and not placing obstacles in the signal path between the RCX brick and the tower.
- Losing commands.
This has occurred most often when issuing motor commands from a sensor event handler.
- Setting the sensor type.
You may experience a narrow window of time in which this works. We recommend setting sensor types in the main form load event of your application.
- Queued commands may keep running.
Even after stopping the running application on the PC, the robot may continue to run queued up commands. In such cases it may be necessary to turn off the brick manually.
We continue to explore resolutions and work-arounds for these issues, but you should be cognizant of them in the meantime when trying to create and debug your applications.