NXT-G PF train control is coming soon to an NXT near you.

Written by Benn Coifman on Dec 23, 2010 in - 0 Comments

HiTechnic sensor


You've likely heard about the mindstorms NXT programmable brick, and know that you can hook up all sorts of sensors and actuators to it. You might even know that HiTechnic makes the IRLink Sensor (also available from S@H) that can control the discontinued RC trains and send commands to PF receivers.

The Mindstorms programming environment that ships with the programmable brick is called NXT-G. Until recently, the IRLink support for NXT-G only emulated PF control with time out (similar to the first PF remote, 8885). If you stopped sending the command or lost connection, your train would stop. But HiTechnic will soon release a new  NXT-G block that supports the set-and-run found in the PF train controller (8879) while also letting you choose the exact speed to operate at (no unknowns twisting the dial).

Mind you, after the release of the PF specifications, such control was already available for the NXT+IRLink, but you needed to download 3rd party firmware (e.g., robotc and NXC). With this block, you can now also realize this control with the programming environment that comes with the NXT.

I was fortunate enough to test out a prototype of the block this month. The added control is very attractive for the AFOL train-head and the potential to have your trains respond automatically based on the NXT sensors could lead to some very interesting layouts (e.g., the ultrasonic range sensor that comes with the NXT or 3rd party RFID sensors could be used for train detection).

Programming it was as easy as working with any of the conventional NXT-G blocks. So if you are already familiar with NXT-G, you should be set to go; but if you are not, expect a bit of a learning curve as you familiarize yourself with programming the NXT. Lego says even a 12 yr old can do it, so don't let the kids have all the fun. So if you're not familiar with programming, expect to take few hours to get up to speed on the NXT itself. Once you do, it is pretty straight forward.

Once you have your program, any single command will control one the 4 PF channels, red or blue output, and set your train speed to the level of your choosing. The speeds range from -7 to +7, where +/-7 is "full on" and 0 is "full stop". Thus removing the ambiguity of "go faster" or "go slower" found with the PF train remote's knobs. Though odds are you'll want to still step up with a few intermediate speeds so that you don't shoot out of a dead stop at run 7. It takes about half a second to send each command out, or 1 second the first time you send a message. You can use one IRLink to simultaneously control all four PF channels, but any given command will be for one output on one channel.

Technically, the IRLink is a sensor because it plugs into a sensor port on the NXT. So it must comply with the low power consumption specifications of the NXT sensor ports. As a result, the range is not as large as you will find with the PF remote controls. I was comfortably getting a range of at least 6 ft, but much further and sometimes the commands would not go through. Of course I have my receivers partially hidden. With a fully exposed receiver, you'll likely be able to get a little more range. Depending on what you plan on doing, you may want to build some redundancy into your program and resend a command more than once.

The NXT+IRLink performed quite well with the new NXT-G block. It offers a great potential for the train fan who wants to take more control of the layout.

About the Author


You must be logged in to leave a reply.   Login