Loginskip to content

Archive for June, 2009

Ada now available on MINDSTORMS NXT

Tuesday, June 30th, 2009

Ada, the language designed for long-lived applications where safety,  security, and reliability are critical is now available on the MINDSTORMS NXT through GNAT GPL: http://libre.adacore.com/libre/tools/mindstorms/

The GNAT GPL Ada development environment is a Free Software toolset targeting the FLOSS and Academic communities. The MINDSTORMS NXT port is maintained by AdaCore (www.adacore.com).

– Matteo Bordin bordin@adacore.com

MCP4 forum applications

Monday, June 29th, 2009

Are You a Hardcore LEGO® MINDSTORMS® NXT User?
Do you want to have a seat in our closed web forum, the MINDSTORMS Community Partners, where we involve you in our development and tests of new ideas, concepts, prototypes, products and discuss various issues around our SW, HW, FW and wetware…?

Then send an application via email with a description of yourself, your involvement with LEGO MINDSTORMS, your special areas of interest, and a paragraph on why you are eligible to be an MCP member!

Send it to mindstormsnxt@lego.com with the header ‘MCP 4 application’.

Applications will be received from now and until 31 July 1200 GMT. All email applications received after this date will be rejected.

Applicants must be 18 years old to apply.

LEGO Beyond Toys

Friday, June 19th, 2009

A facinating university master class dealt with building new sensors for NXT. The outcome is a collection of robots and sensors, including a water pump, GPS sensor, Wireless sensor bridge and an Optical Mouse sensor. Each built with 3D rapid prototyping “legoish” casting. Details on the class and the results can be read here:

Lego Beyond Toys

Lego Beyond Toys 1

Lego Beyond Toys 2

Weather forecasts on your NXT

Tuesday, June 16th, 2009

or communication between an NXT, a computer and the internet.

Quite some time ago I wanted to give a brief tutorial about communication between an embedded program running on the NXT (for example written in NXC) and a computer. The reasons one would want to send data from an NXC program to a PC or vice versa can be divided into two main categories: Either the NXC program wants the computer to do things it can’t (complex calculations, look up information), or a computer program needs to tell an NXC program what to do (or which information to collect or log).

Weather Demo Client Screenshot In the search for a good example I came across this idea: Wouldn’t it be great to show how the NXT could retrieve data from the internet (although the display is to small for a browser ;) )? The first kind of data I could think of were weather forecasts (or current weather conditions). So here we are: This is how it looks if your NXT can show the current temperature and brief conditions of any place around the world (screenshot taken with J. Hansen’s tool NXTScreen).

Short description: The NXC program (client) can request weather conditions by storing a string in one of its mailboxes. The computer program (server, written in MATLAB) constantly looks for messages there via direct commands. If one is found the according weather conditions will be retrieved from the internet using the Yahoo! Weather RSS service. The most important data are extracted and sent back to the NXT (again by storing a string in a mailbox). The NXC program in term waits until a string can be read from the queue, parses it and finally displays city name, current temperature, and condition.

Left and right buttons cycle through multiple locations (i.e. cities); the orange center button toggles between Fahrenheit and Celsius mode! Interested? Read on!

(more…)

What to do next? – Part 2

Tuesday, June 2nd, 2009

During my last blog I gave a very general overview of digital systems and digital communication. Now let’s dive  into development!

To begin you are going to need a development board for an FPGA or microcontroller. I chose the Digilent (http://www.digilentinc.com) Nexys 2 board. It uses a Xilinx Spartan 3E FPGA. You will also want a bread board to develop the communications circuit. Digilent also sells I/O devices called PMODs. I got their servo motor interface PMOD. As a side note, all these components will work with a project for the RCX or NXT.  Finally you will need some resistors to build into the input circuit to keep from frying the FPGA.

Remember how I said digital systems work in pulses? Well these pulses are read every so often as defined by the system clock. For the RCX servo motor controller we have to have two clocks. Using verilog (a programming language for hardware) we can divide the clock into the two clocks we need.  Clock speeds can vary from servo to servo, but expect to program for 10 pulses per millisecond. The other clock will need to run at 10 pulses per second for the RCX. To write code in verilog, you will need a program from Xilinx that will allow you to create the file you download to the FPGA. For help regarding verilog, send me a PM. Wikipedia has good documentation, but once you begin to understand it, it is really easy.

Once you have your two clocks made, let’s work on the important part: the servo PWM. This is the real hard part. For this you are going to need to use one of your clocks (the faster one). You need to be able to control the 0’s and 1’s going to the motor. This can be done with a simple if statements. Again, exact times depend on the motor you choose!

Now you need to read the signal coming from the RCX. I uses eight clock counts (one byte) but you can work with different counts. You want to count up all the 1’s in your chosen cycle. Your code then needs to pass this to the PWM controller and have it decide on the time. That is it. Pretty simple right? Well, try and see. If you can master this fairly simple project (yet one that no one has tackled) then you are ready to work on the NXT!

This is how I approached the problem, and it sets you up for a good basic understanding of digital systems. Wikipedia and google are your friends. Once this all makes sense then you can begin to work on the NXT. I will say the I2C stuff for my next blog, but I think this will take you enough time!

–Andy Milluzzi