To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.trainsOpen lugnet.trains in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Trains / 11468
11467  |  11469
Subject: 
Re: "No Contact" Homebrew Train Sensor for Mindstorms
Newsgroups: 
lugnet.trains, lugnet.robotics
Date: 
Thu, 31 May 2001 23:00:20 GMT
Viewed: 
1946 times
  
In lugnet.trains, Tony Hedglen writes:
Hi everyone.

My name is Tony Hedglen and I’m very interested in automated Lego railroads.
I am a member of Michlug and we are one of the newer clubs. We have done one
train show so far and we won second place. I read these posts on sensors and
I think it’s awesome. I’ve been searching for some time now on how to
automate Lego trains. This is the first I seen someone talk about the
subject. I wold like to learn more. I have no idea on how mindstorms work
and I have basic electrical knowledge. Could someone please help me out on
this subject? Thanks.

Tony

Tony,

If you search back through the .trains and .rcx newsgroups, you'll find a
few scattered gems on the topic of RCX control of 9V trains.  I'll summarize
some of the basics for you here:

The Mindstorms RCX microcontroller brick provides three sensor inputs and
three motor outputs.  The sensor inputs can be configured for use with a
variety of sensor types, including contact switches, rotation sensors,
temperature sensors, and more.  The motor outputs can provide a
pulse-width-modulated voltage output that goes from about -9V to 9V in 15
steps (7 forward speeds, 7 reverse speeds, and "stop".)  When stopped, a
motor can be in either "float" mode (where it can easily be turned by
external forces) or "brake" mode (where a short circuit is applied to the
motor to hold it firmly at its present location.)

In their infinite wisdom, TLC made the electrical connectors used in
Mindstorms compatible with those used in the 9V trains.  So you can use a
motor output from the RCX to supply voltage to the train tracks, and you can
use the motor speed and direction to control the speed and direction of a
train on those tracks.  (Just remember to disconnect the speed controller
from the tracks before you connect the RCX, or you could permanently damage
your RCX.)

This works OK except that the RCX doesn't really deliver that much power to
the tracks.  Even with fresh batteries AND being powered off of an AC
adapter, a small train won't go very fast, and a large train won't go at
all.  Anyway, I have used an RCX to speed-control a small train setup.  I
even wrote a small NQC program that lets me use the IR remote to control the
speed and start or stop the train.

I have also used a type of switch called a "reed switch" to create a new
sensor input for the RCX, as previously described in this discussion.  The
reed switch is activated not by physical contact with an object, but by the
mere presence of a magnetic field near the switch.  I found that this new
sensor could be placed lengthwise along the rail bed to detect the magnetic
couplers of a passing train.

I am a member of NELUG, and for our first (and only) two train shows so far,
we used this setup to detect trains as they approached our street crossings.
This triggered a program in the RCX to flash some signal lights and lower a
set of crossing gates.  This worked amazingly well.  I have previously
posted written instructions for building reed switch sensors, and also
building instructions for my lift-gate mechanism.  I am still planning to do
a more cohesive write-up about this technique when time permits...

Other people have posted details about various other ways to use Mindstorms
to control trains.  For example, there are a few who have posted plans for
how to use a 9V motor to throw a rail switchout remotely.  I haven't built
one yet myself, but I'm planning to drive a switch-yard off of an RCX or two
in a future layout.

Another way people do this is to actually build an RCX into a train (tricky
if you do 6-wide trains like I do!) and let it control cranes and other
machinery on-board the train.  If you aren't afraid to void your warranty,
you can actually modify a train engine (so I'm told) to allow an on-board
RCX to control the speed of the train engine directly.  Though I haven't
tried this, you might be able to control an unmodified train engine with an
on-board RCX as long as you (1) don't connect the speed transformer to the
tracks and (2) don't run more than one train/engine on the track at a time.

You'll also see people using RCXes to automate various "scenery" in their
layouts, usually doing things that aren't directly related to "trains" as
such.  For example, one of our members brought an RCX-controlled helicopter
for NELUG's last layout.  A spectator could push a button which would tell
the RCX to spin the rotor and make the helicopter lift off of a helipad for
a few seconds, then touch back down.  This was a big crowd-pleaser!

Anyway, I hope this quick overview gives you an idea of what is possible
when you combine Mindstorms with trains.  Please post back to share your own
discoveries with everyone if you have any success with this!

- Chris.



Message is in Reply To:
  Re: "No Contact" Homebrew Train Sensor for Mindstorms
 
(...) Hi everyone. My name is Tony Hedglen and I’m very interested in automated Lego railroads. I am a member of Michlug and we are one of the newer clubs. We have done one train show so far and we won second place. I read these posts on sensors and (...) (23 years ago, 31-May-01, to lugnet.trains, lugnet.robotics)

21 Messages in This Thread:








Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR