Getting Your NXT Infraready
Review and Photography by BlueToothKiwi
| Introduction When LEGO® developed the new MINDSTORMS NXT last year, they chose to drop Infrared as the default wireless protocol and instead standardised on Bluetooth for communicating with other NXT bricks and other devices. However, the new HiTechnic ‘Infrared Link’ (or IR-Link) sensor adds the Infrared communication capability to the MINDSTORMS NXT. In essence, it allows the NXT user to: • Control legacy MINDSTORMS bricks (RCX) with NXT and allow bidirectional communications | ![]() |
In this review, I would be focussing on the new HiTechnic ‘Infrared Link’ sensor and how it integrates with the NXT, and how it can be programmed. The review concludes with a real life example of a robotised LEGO® TECHNIC vehicle using the HiTechnic ‘Infrared Link’ sensor.
For the purpose of the review, I am going to use the PF motors to test the HiTechnic ‘Infrared Link’ sensor. First a quick introduction to the Power Function motors.
| Could not generate link to image with ID: | The new Power Function (PF) Motors In the last few months we have seen LEGO® introducing new kits with the Power Function elements. Right now the PF elements ship with the LEGO® Creator Dinosaur, LEGO® Creator Ferris Wheel and of course the incredible LEGO® TECHNIC Bulldozer 8275 that has just hit the market a few weeks ago. The Bulldozer comes with four PF motors in total, two receivers, and one transmitter. The new PF motors are absolutely fantastic - it is easy to attach to the beams as well as to the old style studded LEGO. They are smaller than the NXT motors – see picture below of the PF motors next to the standard LEGO® NXT motor (right): |
The motor comes with its own power pack (with space for 6 AA batteries) which also powers the IR receiver. I managed to get nearly 3 hours of playing from a full charge - so it is pretty impressive.
The LEGO® models with the PF motors ship with a handheld IR remote to control the motors. However, in this review we would be using the NXT to generate the motor commands via the IR-Link instead of using the remote. The next section looks at how to integrate the PF motor and the NXT using the IR-Link.
| Could not generate link to image with ID: | Integrating the PF motor and the NXT using the IR-Link Integration is achieved by wiring up the motors to the power and the Infrared receiver set the channel (1..4) on the receiver and position the IR sensor so it has a line of site to the PF IR receiver and is within its range. The IR-link sensor needs to be plugged into the NXT on one of the four sensor ports (I used port 1 for the first receiver and port 4 for the second). The picture shows the battery pack (from top left), two IR receivers ( that came with PF motors) and the PF motors (top right). Facing the IR receivers is the IR-link in the middle connected to a NXT. The NXT motors (shown in bottom right) can be connected to the NXT in addition to the PF motors – however, they were not used in the tests during this review. |
Could not generate link to image with ID:
| Robotizing a LEGO® TECHNIC model for testing This is pretty straight forward. Given there are two different PF motors with different size and torque – first decide which one to use and then add the motor(s) to your creation. For the review I used an old TECHNIC 8414 – a very small model that is really hard to motorise using the large NXT motors – but it is much easier with the smaller PF motor. However, the PF battery pack and the NXT were too big to fit inside the model – so I put on two wheels and connected it to the 8414. The Ultrasonic sensor (used as range finder to avoid the robotised vehicle hitting anything) and the IR Link sensor were mounted on the NXT as shown below. It is not elegant – but serves its purpose for the test. |
Programming the HiTechnic Infrared Link sensor
You can use various programming languages to control the HiTechnic ‘Infrared Link’ including PbLua and NXC. However, if you want to stick to the visual programming software that LEGO provides (NXT-G), then HiTechnic supply a sensor block, which is extremely easy to use - my 11 year old took 5 minutes to get going with simple PF motor program in NXT-G – dragging the sensor block and setting the parameters:
| The simple NXT-G program at left is used to control the above robotised TECHNIC vehicle. It uses loop block and the new HiTechnic IR-Link sensor blocks: it turns on the motor and keeps it on until there is an object detected by the Ultrasonic sensor within a range (8 inches). The new IR-Link power function sensor block (see at left) allows you to set which port (1..4) on the NXT brick the sensor is connected to and which IR channel (1..4) you want to address. Within the selected channel you can set a motor to go forward reverse or stop. Since there are two motor ports on each PF motor IR receiver, the block allows you to control both motor ports simultaneously – so for example you can have one motor on the same channel going forward and the other going backwards. Of course you can have more than one motor connected to the same motor port within the same channel as well. |
Results
The HiTechnic IR link performed very well in our tests. The simple test worked fine – the vehicle’s PF motors were started by the NXT (via the IR link) and stopped by the NXT when an object was detected in its path by a NXT Ultrasonic sensor. You can see a video here .
We then extended the program by adding more motors on all four of the channels. By using the NXT-G loop block and the HiTechnic sensor block, we had no problems controlling eight motors via four channels simultaneously by cycling through each of the four channels using NXT-G.
There are physical limitations in controlling large number of IR channels programmatically from one NXT and one IR-Link. However, with just four channels available on the PF elements, there is no danger of the remote receiver timing out while cycling through them – and during the testing, we certainly did not come across any problems.
From a robotics point of view, the main limitation with using the PF motors is that the lack of built in rotation sensor in the motor – which means you can not (say) programmatically ask the motor to turn half a rotation or 5 degrees. This is something many NXT programmers take for granted as the NXT motor has built in rotation sensor.
This means you are forced to rely on time lengths of the motor turned on, to control the number of rotations it executes. This is one of the oldest methods used to achieve dead reckoning.
During testing (using the smaller standard PF motor under load), I managed to get 270 degrees turn on the motor by setting the timer to 200ms. Trying to power the motor for any time-lengths less than 200 ms under load did not create any motion on the motor under load.
The second disadvantage that I find irritating about the current version of the PF motors is that it does not allow you to change the power of the motor (e.g. by using pulse width modulation speed control). This means the only three things you can do programmatically – go forward, go reverse, and stop.
Both of these issues are not attributable to the IR –Link sensor – but to the limitation of the Power Function motors and the functionality exposed by the Infrared protocol that LEGO has implemented.
Conclusion
All in all the IR-Link makes the most of the Infrared protocol used by LEGO to control the PF motors. It is extremely easy to use even for a child, and looks elegant and consistent with other MINDSTORMS NXT sensors. The NXT-G block that HiTechnic has implemented is really simple and user friendly.
The IR Link is an excellent addition to any collection that includes a NXT set and the owner wants to leverage legacy RCX brick or make use of the PF motor / train control in their robotic creations. However, if the IR-Link is going to be used to control the PF motors in robotic applications, the limitations of the PF motors must be taken into account.
Hide comments

RSS



Comments

