Loginskip to content

Archive for the 'hacking' Category

More Custom Parts! Flexible Parts and a Custom Motor

Saturday, January 12th, 2008

A custom flexible Technic part

A Custom Lego Motor

Sibrecht Bouwstra, a student at the Technical University of Eindhoven, just published a project report describing custom Technic parts. Her project focused on two kinds of parts: flexible parts, which you can see in the top picture, and a motor (she wanted to make a silent, or more precisely very quiet, motor). The report describes several different methods of making flexible parts, and the picture above shows the most successful products. The motor unit includes a motor with internal gearing (using a worm gear).

Sibrecht’s web site includes a detailed illustrated project report and a movie showing the motor driving these flexible elements to create a fluid motion (click on Gallery then Lego).

Thursday, October 18th, 2007

The home-built IR Link

I just posted a writeup on an IR Link that allows the NXT to send commands to the Power-Functions receiver (the commands tell the receiver to turn the Power Functions motors on and off) and to receive commands from the Power-Functions remote control. The device can keep sending a “turn on” command to the Power-Functions receiver repeatedly on its own, thereby keeping the motor on without requiring further NXT communications. You can buy such devices from both HiTechnic and Mindsensors, but it was fun to build one. Some of the interesting aspects of this project are:

  • Deciphering the Power-Functions communications protocol,
  • Using an external AVR microcontroller with the NXT, and
  • Automatic configuration of the I2C pull-up resistors.

NXT-G and GPS - closer than ever?

Saturday, September 15th, 2007


I’ve been working on the issue of BT GPS connection for the past few days, ever since Antonio’s NXC code demonstrated that this is a possibility. In the LabView diagram above (click here for full resolution image) I show a preliminary step toward this goal. I’ve made VIs (i.e. the LabView term for blocks) that read an ASCII stream, and some prelimiary string parsing VIs. Since I have no BT GPS, I had my PC connect as the slave device, and wrote another LabView code that sends the NMEA-0183 formated string:
$GPGGA,023346.028,3604.1654,N,08655.7973,W,0,00,50.0,198.2,M,-31.6,M,0.0,0000*76\r\n
at specified intervals (e.g. each 1000 milisecond).
The resulting file stored on the NXT contains a long list of this message:
GPGGA,023346.028,3604.1654,N,08655.7973,W,0,00,50.0,198.2,M,-31.6,M,0.0,0000
GPGGA,023346.028,3604.1654,N,08655.7973,W,0,00,50.0,198.2,M,-31.6,M,0.0,0000
GPGGA,023346.028,3604.1654,N,08655.7973,W,0,00,50.0,198.2,M,-31.6,M,0.0,0000
GPGGA,023346.028,3604.1654,N,08655.7973,W,0,00,50.0,198.2,M,-31.6,M,0.0,0000
.
.
.
without any errors so far. From another test is seems that as I suspected the NXT ‘catch’ the GPS data correctly every 2-3 cycles of my “GPS” data stream.
What’s next? Parsing the GPGGA data, and making the NXT-G block around all this… Keep watching for it!

In the meantime, Antonio posted me an improved version of the code. He claims this code loses only 20% of the messages (compared to ~60% in mine, and his old code). You can download the new code here. I still need to figure out what makes the difference, and see how I can implement it in LabView…

Questions/comments - use this forum topic.

Guy Ziv

Standard firmware and GPS data

Friday, September 14th, 2007

As I posted yesterday, Antonio Scarfone made a NXC code that managed to read a Bluetooth GPS textual (NMEA-0183 format) readout. I’ve tried the same thing long ago, but for the reasons listed below dropped this project thinking it is impossible…
Why did I think so? Well, the Bluetooth SDK describes in the end of Appendix 1 (Communication protocol) the structure of the “expected” ‘data packet’ - 2 byte packet size, command type byte, command byte and data. This is very different with NMEA format which starts with e.g. $GPGGA and ends with *XX\LF\CR (XX is a 2 char hex checksum, \LF\CR are line feed and cartridge return chars). For me, and many other AFOLs this inconsistent format seemed impossible to overcome with the standard LEGO firmware. Other firmware like pbLua (and soon RobotC) have BT ’stream-mode’ where program can deal with the BT port like simple serial port. GPS communication with pbLua was reported a while ago, and Steve Hassenplug recently converted his Green Monster to use GPS with RobotC. But using GPS with NXC or NXT-G? I thought it will never happen.
All this was true till Antonio’s code came about. I’ve spent several hours looking at the code and going over the firmware source files trying to understand how this works. Here’re my preliminary conclusions. (more…)

NXTAssembler 1.0 version alpha 2

Saturday, July 28th, 2007

Matteo Valdina (website) created a new compiler for NXT, similar in function to NBC (i.e. creates .rxe files executables for the NXT) but based on XML. The last release is version alpha 2 of this ‘NXTAssembler 1.0′. You can download it here - http://sourceforge.net/projects/nxtassembler.

Examples of source code can be found in the folder “AsXML Test/program” in the package.

The project require Java 1.5 or newer and for building require “ant” tool (http://ant.apache.org/).

see also this topic on our forums for discussion of this new project.

Using Stepper Motors

Monday, June 18th, 2007

A Stepper in a simple NXT construction

Steppers are motors that move in discrete steps. You can control them to move a given number of steps without any feedback. You can rotate them slowly but with a lot of force without using any gears.

See full description of the project (which includes a video) to learn how to integrate a common stepper motor into a NXT creation and how control it.

My controller was influenced by a stepper controller that Michael Gasperi posted to one of the forums. See the forum for the Michael’s circuit and program, and click here for a video of his stepper in action.

A Solenoid-Triggered Gun

Monday, June 4th, 2007

A solenoid-triggered cannon

The NXT servos and other Lego motors are useful actuators, but it’s interesting to explore other actuators. The “Extreme NXT” book by Michael Gasperi, Philo, and Isabelle Hurbain shows how to use many more actuators with the NXT: LED’s, lamps, relays, motors, and a really exotic one called a muscle wire. But it’s always an interesting challenge to find out how to control new kinds of actuators, and it’s often even more interesting to find out ways to integrate them into the Lego/Technic/NXT building system.

In this project I tried to use a solenoid, which is basically an electromagnet that pulls a metal plunger when current flows through it. There were three main challenges in this project: to integrate the solenoid into a Technic mechanism, to find a good use for it in spite of the very short stroke (length of movement), and to drive it either from a motor port or from a sensor port. The difficulty in using a sensor port is that sensor ports cannot provide the high current required to activate the solenoid.

A web page describes the project with pictures and a short video. If you are interested, you may also want to join the lively discussion on actuators in the hardware forum.

Toy Piano Interfaced to NXT

Sunday, June 3rd, 2007



Gasperi does it again! Here’s a toy piano with 23 ’switches’ (i.e. keys) interfaced to one NXT port, using two PCF8574s. More info here.

Keep the volume down, or this robot will turn off the TV

Saturday, March 17th, 2007

If the TV plays too loud, this robot raises its arm and turns it off.

This home-made i2c-controlled infrared remote control can turn off the TV (or give it other commands, like lowering the volume or change channels). It is used in this robot to turn the TV off if the sound is too loud.

The most interesting aspect of this project is the use of a microcontroller in the circuit. The microcontroller listens to i2c transmissions that the NXT sends via one of the sensor ports. The transmission from the NXT contains the infrared command to send. Once such a transmission is received, the microcontroller generates the appropriate infrared signal.

The full description of the project describes how to program a low-cost microcontroller ($20 will buy both the microcontroller and the device to program it) and how to interface it to the NXT. The full description also includes a short video showing the robot actually turning of a TV with this home-made remote.