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 / 7908
7907  |  7909
Subject: 
Re: mindstorms crossings
Newsgroups: 
lugnet.trains
Date: 
Mon, 23 Oct 2000 21:09:09 GMT
Viewed: 
936 times
  
"Dan Boger" <dan@peeron.com> wrote in message
news:20001023092608.K798@xif.com...
On Mon, Oct 23, 2000 at 11:51:06AM +0000, kai brodersen wrote:
I dont know if anyone has done this but, making a level crossing then • using
mindstorms to lower the gates?
the thought intrested my just wondering.

yup...  Tom Cook (with a little help from me) figured out how to do this.
  http://www.peeron.com/pics/Chantilly/
(click on the "crossing" mpg at the bottom).

Yes Dan and I developed two versions of the automated level crossing.

The first version is a single track crossing.  It utilizes three light
sensors:  one AT the crossing, and one at each approach.  When one of the
approach sensors is triggered the gates are lowered, and then the middle
sensor (at the crossing) waits for the train to arrive.  It is now
triggered, so it waits until it detects NO train for a finite period (about
half a second; this is important, otherwise the light through the gaps
between cars would trigger the sensor).  After the finite period, the gates
are raised.  The third sensor is ignored, but waits for the train to be
clear of it, before resetting the program.

The advantage of the this setup is that it allows the gates to be raised
almost immediately after the train crosses (i.e., you don't have to wait for
the train to clear the far approach sensor), and the spacing of sensors is
closer together so short trains don't confuse it.  It also works for trains
running in either direction.  Two sensors will work, but you just have to
wait longer and short trains (that are in between the sensors) will cause
the gates to go up when the train is on the crossing.

The second version is for multiple tracks.  We use only two sensors because
the program had to handle multiple trains at once and it doesn't know if a
train is leaving or entering when an approach sensor is triggered.  This
version lowers the gates whenever an approach sensor is triggered, then it
records the state of the gates as DOWN.  This keeps a second or third train
from cause the gates to attempt to lower themselves while the gates are
already down.  Then it waits for both sensors to be clear for a finite time
before raising the gates and recording the state as UP.

The advantage is that it's simpler, and it works for one or MORE tracks.
The disadvantage is that you have to wait longer for the gates to raise, and
short trains will confuse it.

I don't have the NQC code with me right now, but I will try to post it
later.



Message is in Reply To:
  Re: mindstorms crossings
 
(...) yup... Tom Cook (with a little help from me) figured out how to do this. (URL) on the "crossing" mpg at the bottom). :) (24 years ago, 23-Oct-00, to lugnet.trains)

9 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