Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline DaleSchultz  
#1 Posted : 01 November 2018 04:01:45(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
So, many folk like to have a physical track control desk that is rather like the prototypical control desks. These desks show the status of trains and typically have push buttons that can be set to set routes etc....

Simulating this in software is very doable, for example: https://cabin-layout.mixmox.com/2018/09/layout-software-UI.html and such software implementations can also easily respond and do the work of the physical desk when the push buttons are connected to s88 type sensors.

Now these physical desks also show train and turnout status, for example:

white indicates a route is set
red indicates a train is present
off (black) indicate free track
yellow indicates the position of turnouts

This too, can be done by adding LEDs into the desks and using k84 decoders to switch them on and off as needed. (I can already do all that in my own software.)

The problem is, that in a typical track diagram of a station, the number of track segments that have to be individually switchable, add up very quickly, and if a track is to be switched between off(empty), white(set/reserved) and red(occupied) using k84 decoders to switch the status demands 2 addresses per segment! This is starting to get very expensive. (Think of a track diagram of a station where a line may branch into 4 tracks and back to one again at the other end - that is 17 separate segments of track!)

Now a few years ago I noticed that there are special LEDs that can be connected in a string (and one can buy them in strings) and each LED has its own driver allowing each LED in the string to be individually controlled. (See neopixels.) These could present an elegant solution to displaying the status of tracks in these control desks. One can install a strip of them under the track representation and have the layout software switch them to the appropriate colours.

Switching them needs a small processor such as an Arduino. These are relatively cheap and indeed some people have created full train control systems using such devices. The next hurdle is how does the software running on a (say) a PC communicate with the Arduino to inform it when to set the LEDs etc...? Well there are Ethernet and wifi modules one can attach making that technically possible. (I have not yet tried it.)

In browsing these add-on modules I came across one called a CAN shield.
https://store.arduino.cc/usa/arduino-mkr-can-shield
and it certainly seems that this would be able to read our train data directly from the CAN bus, and indeed I think this is what some member here may have done.

So now I am thinking, that in order to create an economical method of displaying the track status lights, it should be possible to do this:

  • Use an Arduino processor to drive a set of neopixels.
  • Map runs of the neopixles to segments of track (eg pixels 6 through 10 = segment 5)
  • Attach a CAN shield
  • Send commands through the track (DCC/MM) to inform the Arduino what lights to switch on and what color etc. These commands could be like sending k84 type commands for example:

address 300-red could mean set track segment 4 to red
address 300-green could mean set track segment 4 to white
address 301-red could mean set track segment 4 off
address 302-red could mean set track segment 5 to yellow and segment 6 off
address 302-green could mean set track segment 5 off and segment 6 to yellow

This would allow any combination of track status and turnouts to be displayed, using only accessory addresses. As you can see, track status segments use two addresses, and turnouts use one each.

I am hoping someone here may be able to comment on the feasibility of this idea...

Can we pick up accessory commands sent out via the track digital signal?

Would it be easier to send the commands to the Arduino via wifi and TCPIP? (perhaps using HTTP POST calls that simply send all the color bytes for the neopixel string)

Is there a better solution? (other than using a computer display!)



Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
thanks 2 users liked this useful post by DaleSchultz
Offline mario54i  
#2 Posted : 01 November 2018 18:50:12(UTC)
mario54i

Italy   
Joined: 28/03/2007(UTC)
Posts: 303
Location: Torino,
Originally Posted by: DaleSchultz Go to Quoted Post

  • Send commands through the track (DCC/MM) to inform the Arduino what lights to switch on and what color etc. These commands could be like sending k84 type commands for example:[/list]
    address 300-red could mean set track segment 4 to red
    address 300-green could mean set track segment 4 to white
    address 301-red could mean set track segment 4 off
    address 302-red could mean set track segment 5 to yellow and segment 6 off
    address 302-green could mean set track segment 5 off and segment 6 to yellow


  • Please let me understand: do you want to send to Arduino commands in the MM/DCC format as if it were a giant k84 decoder connected to rails ? Who generates these commands ?
    If it's a program in your PC and you write it, why not communicating using serial interface, passing through the USB connections of PC and Arduino ?

    Regards


    Offline DaleSchultz  
    #3 Posted : 01 November 2018 19:38:42(UTC)
    DaleSchultz

    United States   
    Joined: 10/02/2006(UTC)
    Posts: 3,997
    Originally Posted by: mario54i Go to Quoted Post


    Please let me understand: do you want to send to Arduino commands in the MM/DCC format as if it were a giant k84 decoder connected to rails ? Who generates these commands ?
    If it's a program in your PC and you write it, why not communicating using serial interface, passing through the USB connections of PC and Arduino ?

    Regards


    My software already generates the commands, and I would do it with wifi because the control desk is a long way from the PC controlling the layout.

    I have found WLED at https://github.com/Aircoookie/WLED which seems to do everything I need - generic wifi with UDP or HTTP control over every LED.

    If I go that way, I will generate the UDP data instead of sending it as accessory commands.

    Now I have to work out what hardware to buy.


    I am still interested to know if the CAN shield can pickup DCC/MM commands though as it could be an easy way to reflect turnout and signal status data directly.
    Dale
    Intellibox + own software, K-Track
    My current layout: https://cabin-layout.mixmox.com
    Arrival and Departure signs: https://remotesign.mixmox.com
    Offline DaleSchultz  
    #4 Posted : 02 November 2018 02:01:12(UTC)
    DaleSchultz

    United States   
    Joined: 10/02/2006(UTC)
    Posts: 3,997
    I have ordered a sparkfun ESP8266 Thing Development board and a logic converter to go from 3.3V to 5V
    so I will see how well this works. I am sure this approach will also work for making Ho scale traffic lights.
    Dale
    Intellibox + own software, K-Track
    My current layout: https://cabin-layout.mixmox.com
    Arrival and Departure signs: https://remotesign.mixmox.com
    Users browsing this topic
    Guest
    Forum Jump  
    You cannot post new topics in this forum.
    You cannot reply to topics in this forum.
    You cannot delete your posts in this forum.
    You cannot edit your posts in this forum.
    You cannot create polls in this forum.
    You cannot vote in polls in this forum.

    | Powered by YAF.NET | YAF.NET © 2003-2025, Yet Another Forum.NET
    This page was generated in 0.348 seconds.