2021-11-27

Android Cab control

At times I seem to get fixated on making a cab view control and to date I have made five such cab controls, each time with different technology, and each time it gets a bit better.


My first effort was built into the train control software.


Then I got an HP PDA device that had a wifi connection so I wrote a program that ran on that.


Then I made one that would display in a browser. In this version, I managed to superimpose signals showing the current signal aspect into the image.


Then I made one that would run on a phone using Blynk technology. It did not allow the flexibility to position the signal in the image so I displayed signals to the side, but at least it was now on my phone.


And now, I have made one that runs on a phone (and Windows) using AppGameKit

This version has a better speed display, in addition to the track speed limit and current desired speed of the train, speeds above the speed limit of the (lead) locomotive are shown in red. The speedometer scale also changes dynamically according to the maximum speed of the current locomotive.

As before, all available digital functions can be invoked by buttons, but now the buttons also make a realistic click sound. It also superimposes signals onto the track image. When one touches any control in the cab, the image outside the window goes out of focus for half a second to simulate the depth of field of the driver's vision.

It now also features a cab window frame with windscreen wiper.

The Locomotive name and current odometer is also displayed. The odometer changes as the train travels about and is an actual distance covered by that model, accumulated over the years.


When the signal changes it shows immediately.


A new feature is the ambient light of the track image can also be simulated from bright and sunny to pitch dark. The locomotive headlights light up the image too! Here it is getting somewhat dark and the loco lights are on.


In total darkness and no headlamps!  The ambient light data comes from the layout control software which will relay the current ambient light of the layout room. So, as a sunset occurs, we see sunset colors in the cab control on the phone!

(I plan on perhaps not having the reflective stripes show up without the headlamps.)


When inside an underground station that has its own lighting, the image is of course not darkened.

Oh, and it can also announce destinations etc. in German. When the train being viewed is dispatched there is a voice announcement stating that the driver has permission to start and what the destination is. If a trip is cancelled, that is also announced. 

When the train has been dispatched, the desired speed is indicated with a yellow marker on the speedometer, and also presented (below the digital speed indicator) in yellow. 84Km/h in this example:

As before, it can also:

  • Turn layout track power on and off
  • Disable unexpected train alerts
  • Pick any train and dispatch it to any destination.


  • Trigger any event in the train control software
  • Set any accessory address to red/green
  • Monitor any sensor address

The track images are cached on the phone. If the software is directed to use an image it does not have, it fetches the image from the Bw software. It can also request all the images for all tracks and caches those for instant loading as needed.

It is based on the RemoteSign command set, communicating with my Bw train software over the network.

I might add the Buchfahrplan information display so the person driving the train sees the prototypical journey information as they progress along their trip.

Update

I have added a throttle so one can control the acceleration and braking of the train.

I have also added Indusi, Sifa and AFB features.

The Indusi system warns the locomotive driver about upcoming signals and they have to acknowledge these warning by pressing an acknowledgement within 30 seconds, and bring the train speed below a certain threshold within 20 seconds. If these conditions are not met the emergency brakes are applied. The allowable speed for the train after passing 1000Hz Indusi transponder is also indicated with the prototypical flashing. The system automatically sets the Indusi category (which in turn governs the speed limits allowed) based on the train definition in the main layout control software.

Here an ICE has passed a 1000Hz Indusi magnet and has 20 seconds to get below 85km/h (and is only doing 70)


Sifa is an additional driver attentiveness system that requires a button to be pressed periodically. If the button is not pressed, then a verbal warning is made in the cab and if the Sifa button is still not actuated, the emergency brakes are applied.

The AFB (Automatische Fahr- und Bremssteuerung) mode can be switched on and off. When it is on, the system controls the speed of the train itself. When it is off, you have to set the throttle/brake control manually to regulate the speed of the train.

Here an ICE is coasting along at 107km/h with AFB off.


A train with the lowest speed category in a hidden area awaiting a green signal


An S-Bahn train in the middle category: