ETCS DMI — the driver's display of the European Train Control System

The Driver Machine Interface (DMI) is the cab display that tells a train driver how fast the train may go, where and how hard it has to brake, which mode and level the on-board system is in, and what lies ahead on the track. This project implements it after the European Union Agency for Railways specification ERA_ERTMS_015560 v4.0.0, in Ada 2012, aimed at small embedded hardware: a 32-bit microcontroller around 200 MHz with 128 kB RAM and 1 MB ROM, no operating system and no libraries beyond the compiler's runtime. Every pixel is drawn by the Ada code into a frame buffer; fonts and symbols are bitmaps compiled into the program.

What runs below is that same Ada code compiled to WebAssembly; nothing is reimplemented in JavaScript. The DMI and the ETCS on-board computer (EVC), with a track and train model, run as two separate modules that share no memory and exchange the binary messages they would exchange over Ethernet on a train; a third module, a simplified on-board the DMI's golden frames were recorded against, can take the real one's place. This page plays everything around them: the display, the touch screen, the loudspeaker, the driver's desk and the cable in between, which you can degrade or cut to see how the DMI copes.

How to try it
  1. Start a mission. The DMI opens with the start-up dialogue: enter a driver ID, then pick Level 1 from the level keyboard and accept it on the field above it. The driver ID takes letters too: its keys carry a number and three or four letters, and pressing the same key again within two seconds walks through them, as on a telephone keypad. The two buttons in the bottom corners lead to the Settings window and to the train running number. In the Main window that follows press Train data: the seven train data items need two windows, so fill the train category, length, brake percentage and maximum speed, press ▶ for the second window (axle load category, airtight, loading gauge), then Train data entry complete? and Yes, confirm in the validation window and enter a train running number. Type a value on the keypad, or press one key of a dedicated keyboard (More shows the next group of choices), and touch the grey data field itself to accept it: the field is the enter button. Touching another field selects that one instead. Back in the Main window Start is now enabled: press it.
  2. Watch the run. The EVC grants a movement authority over a 10 km demo track and the automatic driver sets off: speed restrictions, a neutral section, a level transition you have to acknowledge on the DMI, an unprotected level crossing, a tunnel, and the braking curve down to the end of authority. The system status message Entering FS stays until the train has run its own length. The strip above the DMI shows where the train is.
  3. Let the ATO drive. Press the wrench (Settings), then ATO, choose On and accept it on the field: the ATO information appears (DMI 8.5). The yellow ATO symbol under the planning area means the ATO is ready: touch it to engage and the mode becomes Automatic Driving. The ATO drives to the stopping points of the journey (Welwyn North, Knebworth, Stevenage), stops, shows the stopping accuracy, the dwell time or train hold and the doors, and disengages itself; touch ATO again to go on. Touching the engaged symbol disengages (with the warning sound); holding the skip symbol on the right for two seconds skips the next stop. With the ATO on but not engaged, the automatic driver follows the ATO's advice: target speed on the dial, coasting below it and the advice change in the planning area.
  4. Drive yourself. Untick Auto drive and use the throttle/brake slider. Go over the permitted speed to get the warning colours and sounds, further and the EVC brakes for you.
  5. Break the cable. Add latency, jitter, loss or fragmentation under EVC ↔ DMI wire. Tick Cut the link: after one second of silence the DMI discards the picture and shows the system failure symbol; untick and it recovers. Reordering shows what the protocol does not yet survive.
  6. Radio, shunting and Supervised Manoeuvre. Pick Level 2 in the start-up dialogue instead: the Radio data window follows. GSM-R network ID (hold it two seconds) makes the EVC look for networks while the hour glass runs in the title, then offers three; pick one and watch the registration. Use short number or Enter RBC data open a session with the simulated RBC, after which the Main window offers Initiate SM (hold it): the RBC authorises it after two seconds and the DMI shows the SM symbols; Exit SM leads back to the start-up dialogue. Radio network type FRMCS+GSM-R leaves the FRMCS unregistered (the demo line has no FRMCS network) and puts Mission with one radio system on offer. In level 1 Shunting switches to SH at once; Special offers the BMM reaction inhibition.
  7. Settings, VBCs and the data view. Before Start (standstill, mode SB) the wrench opens Settings: System version shows the operated system version the EVC reports (3.0). Set VBC takes a Virtual Balise Cover code on the keypad (NID_VBCMK, NID_C and the validity in 24 bits, e.g. 321456), Yes leads to the validation window and only its Yes sends it to the EVC, which stores it; Remove VBC takes the remove code (NID_C first: 50078 removes 321456, 15460 removes 71951, which is stored from the start). The Data view (default window, right column) lists them on its second window with the radio data. Choosing level NTC puts the name of the simulated National System, PZB, in the level symbol.
  8. Language. The flag in Settings opens the Language window: Deutsch (or Magyar) and accepting it on the input field turns every window, button, key, data view item and system status message of the DMI into German (or Hungarian, in the wording of the MÁV ETCS operating instructions) at once, the ones already displayed included (the texts the EVC sends stay as they are). The DMI keeps the choice over a restart, like the brightness and the volume, and tells the EVC (the console shows language "de" or "hu"); English brings it back.
  9. The real on-board (the default). On-board: ETCS on-board runs the ETCS on-board of the project (SUBSET-026, in SPARK, evc/) in a simulated environment: balise groups along a line, an odometer with its error, the train interface and a train that obeys its brake commands; simulator (mock) puts back the simplified on-board the DMI's golden frames were recorded against. With the real on-board the driver does the whole start-up dialogue of the first bullet on the DMI itself (no page button): it powers up in Stand By, brakes a standing train that moves without a movement authority, and once 'Start' and the mode proposed are acknowledged runs the mission exactly as the first two bullets describe, down to the stop at the end of authority. Track: features demo puts the on-board on a second line instead, built to be driven into an On Sight profile, a level transition to level 0 and back (press Override in time to come back without tripping, DMI 11.2.2, 5.8), a "stop if in SR" balise (the same window, for both outcomes), a Shunting area (announced by the trackside, acknowledged like On Sight) and a text message to acknowledge. The panel below the wire shows its mode and level, its train interface commands with the reasons of a brake, the second TIU output of 5.20 (the information for an external function: pantograph, main switch, air tightness, braking, traction and platforms) and its juridical records; a "Train interface" fieldset offers the cab, the direction controller, sleeping, passive shunting and non leading permitted and the train configuration of TIU input 13, the inputs the DMI itself has no window for.
  10. Feed it by hand. Switch the source to the manual EVC panel to put any speed, target, mode or level on the display. Its last rows raise any system status message of chapter 15 and send the events the EVC reports (see which ones end after 30 s, on a button of the Main window or when the mode changes), and set the on-board's radio data, waiting states and list of GSM-R networks, the name of the National System of level NTC, the system version and the VBCs stored on-board. TTI s puts the Time to Indication in A1 (FS, CSM): below TdispTTI the white square grows one step every tenth of TdispTTI, 1.4 s for the 14 s of the ETCS; step it by 0.1 s to see the bounds of DMI 8.2.2.5.3.
  11. The keys under the display. Settings is the desk button for the Settings window (DMI 8.6.1.6): it works where the wrench does, on the default window. There Volume and Brightness take a level from 0 to 10; the display dims and the sounds get softer, never dark or silent, and the DMI keeps the values when the mission is reset. Isolation isolates the on-board (DMI 5.6.1.1): hold it for two seconds and release it. The simulator enters the mode IS, which has no symbol on the screen: the lamp of the key shows it. Only Reset mission leaves IS.
  12. The clock. The ETCS on-board takes the browser's clock in UTC at every reset (SUBSET-026 3.18.5.1) and counts the simulated time from there, so the clock of the DMI and the dates of the juridical records are today's, slower or faster when the simulation is. The time shown is UTC: the local time comes from the time zones of the installation configuration (format version 3, by the country of the last balise group), and the bench's configuration has none. The smoke tests keep the fixed reset time 2026-01-01 00:00 UTC.

A personal project for learning Ada and for testing how far an AI coding agent can be used in developing reliable software; not certified and not for operational use. Source, specification and tests (GPL-3.0): github.com/milanredele/etcs-dmi.

Test bench (loading modules…)

0

EVC ↔ DMI wire

Manual EVC panel (sent cyclically while the source is the manual panel)
ETCS DMI
brightness – · volume –