Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Computer control

2015 views
7 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    May 2009
  • From: NZ
  • 5 posts
Computer control
Posted by garagerails on Thursday, October 8, 2009 6:23 PM

computer control front panel Hi,

 I've just written this software program which will run my railroad. It's capable of running 64 outputs through the printer port. I'm only using 16 at the moment. This is stage 1, which is a computer based representation of a traditional looking panel. The next step will be to replace all the switches with track selectors, so you just select where and the points are set automatically.  I've attached a pic of the front panel.

 Its a DC layout, and eventually I hope to control the track power by computer as well.

The stop button will terminate the software. Once you select the turnouts you want, then by pressing the throw switch buttons the printer port will configure and turn a relay off or on to control the points.

I'm interested in any tips or anything that I might have overlooked. Any suggestions ?

 

I wrote this program with labview.It has 4 stages, Input, Process, Indicate and Output

Input stage reads the switches and converts the combination to a binary value.

Process stage, the binary value then is used to select a 'case'. Each case is configured to throw the required switches and indicate the path on the ladder.

Indicate stage. This is really an output, but is actually only a display driver. Each case will drive the required indicators to light the correct path. When the operator is happy the right path has been selected,  then the output stage is ready.

 Output stage. The operator presses the button which configures the printer port and throws the relays. This could be automated but I chose not to. Although I'm using the printer port, it would be extremely easy to convert the output to USB and run a I/O unit.

 

 

  • Member since
    December 2004
  • From: Bedford, MA, USA
  • 21,483 posts
Posted by MisterBeasley on Friday, October 9, 2009 10:29 AM

I would first use a graphics file (BMP, JPG, etc.) as an input for the screen background.  The user would provide this.  It would be a schematic of his layout.  Each turnout control would then positioned by the user, in both (x,y) and rotation angle, to correspond to its position on the layout.

The output should allow for both momentary (twin-coil) and continuous (stall motor) turnouts.  This would be, ideally, done on a switch-by-switch basis.

Make your printer-port I/O very modular in software design.  Consider the very real possibility that the user might not have a printer port on his machine in the near future.  (Think back to "game ports" on computers.  These were 9 or 15-pin D connectors that were used for joysticks, etc.  These have all gone to USB now, and its hard to find even after-market boards to support the old hardware and software.  Even worse, the old drivers don't function under XP or Vista.)  With printers going either USB or local network based through your router, it won't be long before manufacturers skip the printer-port output completely to save cost.

It takes an iron man to play with a toy iron horse. 

  • Member since
    January 2009
  • From: Maryland
  • 12,897 posts
Posted by ATLANTIC CENTRAL on Friday, October 9, 2009 12:57 PM

I'm sure your having fun doing this yourself, but it has been done and you can get it for free. Take a look at www.oaktreesystems.com They have software and hardware to provide both computerized block control as well as detection and signaling for DC or DCC.

Sheldon 

    

  • Member since
    March 2007
  • 2,751 posts
Posted by Allegheny2-6-6-6 on Friday, October 9, 2009 10:48 PM

 Have you written in a provision for a manual override? Lets say your computer crashes not like that ever happens........lol what happens to trains that are running switches etc. I have seen several large layouts that have computer controlled CTC machines to handle large numbers of trains as many as 40 and multiple switching operations is this geared towards something like that or the basic plywood central

 

Just my 2 cents worth, I spent the rest on trains. If you choked a Smurf what color would he turn?
  • Member since
    October 2009
  • 1 posts
Posted by Watashiwa on Saturday, October 10, 2009 8:53 AM

I am interested in controlling my "N" scale trains from the computer.  I plan on using DC control of blocks.  Each block will have an IR detector at each end that will feed back to the computer so it (the computer) knows when a train enteres a block and leaves a block.  I put a reflective tape under the tender and the caboose. 

I want to use Micro Controllers (Parallax or other) to drive "H" bridges for each block that receive comands from the computer.  MC will also be used to set switches and send back to the computer the IR detector information.  It'd like the computer is the dispatcher, and the MC is the engineer.

Hope at least some of this makes sence to you.  I think Misrosoft Visual Basic Ver 5 will do this for me.  Quick Basic didn't seem to work in both directions at the same time, although I did get it to work in both way one at a time. 

  • Member since
    January 2007
  • From: Eastern Shore Virginia
  • 3,290 posts
Posted by gandydancer19 on Saturday, October 10, 2009 12:21 PM

 CTI Electronics also has a system that can be used for DC, and DCC if you decide to switch over sometime. http://www.cti-electronics.com/

I know you may be having fun, but if you don't want to re-invent the wheel........

I have used this system for a DC layout and it is really good in my opinion.

Elmer.

The above is my opinion, from an active and experienced Model Railroader in N scale and HO since 1961.

(Modeling Freelance, Eastern US, HO scale, in 1962, with NCE DCC for locomotive control and a stand alone LocoNet for block detection and signals.) http://waynes-trains.com/ at home, and N scale at the Club.

  • Member since
    March 2005
  • From: in canada B.C.
  • 49 posts
Posted by 7h9h_ on Saturday, October 10, 2009 3:32 PM

i like the program that you made!!!

i'd like to use it for my N scale layout

 

Aaron

 

 [br]i want to make a running model of the
Stevenson's Rocket but first I need the blue prints (the full scale)
  • Member since
    May 2009
  • From: NZ
  • 5 posts
Posted by garagerails on Saturday, October 10, 2009 9:35 PM

 Hiya, yes good point.Will build a simple switchbox that can take the place of the computer, with a DB25 plug on it so it will plug straight in. Cheers

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!