Skip to main content

A really detailed look at the "add engine" command

Hi Again!

 

===========ABSTRACT===========

I think that it's pretty common knowledge that if DCS isn't optimal that the add engine command tends to struggle more than the simpler ones (whistles, speed commands and such). I figure some folks might already have the deep understanding into this, but I wanted to put it up in detail because several people asked me to, most recently rad400 on the other post.

 

========== SNR and BER ========== 

To start this discussion we need a bit of communication theory, but not too much and I'll try to keep it sort of qualitative and skip the mathematics. The most basic quantity in communications is called signal-to-noise ratio or "SNR". Noise is complicated to talk about, there are many types: noise from power supplies (called line noise), noise from digital circuits nearby (called switching noise), noise from the transistors in the circuits themselves (called thermal, flicker, shot, and Nyquist-Johnson noise), and noise from something like a model train that runs down the track and makes and breaks connection (called point noise). You don't need to know exactly how much of what type of noise you have to analyze a communication system, just the total amount of unwanted noise power compared to the power of signal you are sending. In many cases signals from unrelated systems are even considered noise (like TMCC to a DCS system is considered a noise because its energy in the system that doesn't help send a DCS signal).

So SNR is essentially (signal energy you want) divided by (any noise or signals you don't want).  For trains you can think of it like the "strength" of the DCS signal telling your train what to do divided by the "strength" of *any* other signals on the track.

The second concept we need to borrow is Bit Error Rate (BER for short). Bit error rate describes how often a bit is sent wrong (like I sent a 1 to the train but it got a 0). There is a direct relationship between the SNR and the BER. The lower the SNR, the higher the BER.

If you have a weaker signal, more bits will be wrong. This is fundamental to all communication systems (cell phones, wifi, space missions, trains...whatever). Depending on exactly how you encode the data and modulate, the exact coefficients of the relationship change, but the general story is always the same: BER goes up when SNR goes down.  This is often represented with a SNR to BER plot which does the conversion for a given type of communication.

DCS uses a type of encoding called CDMA (Code-Division Multiple Access) with a modulation called bi-phase line code (meaning it has both + and - voltage in the waveform). The SNR-BER relation for CDMA-biphase looks like this:

SNR_BER

SNR is usually expressed in dB which is 20*log10([volts signal]/[volts noise]). So 6dB is a factor of 2 in voltage, 12 dB is a factor of 4 and 20 dB is a factor of 10. So for example if you look at the plot, you can see an SNR of 6dB (meaning the signal voltage is 2X higher than the noise voltages) gives you a BER of 9x10^-1 or roughly 0.09. What this is saying is

If the noise voltage is half the signal voltage then of every 100 bits I send, 9 will be screwed up.  Similarly at 12dB (a factor of 4) the BER is almost 10^-5 meaning for every 10000 bits I send, approximately 1 will be screwed up.

So the take away is a weaker signal or a stronger noise/interference (a lower SNR) means a higher chance that bits will be screwed up.

 

==========How command length and BER relate ========== 

All the DCS signals are sent with the same strength because they all come from the same transmitter circuit. No commands are weaker and no commands are stronger. The only difference is the length of them (the number of bits inside).

So for example (it's not really these numbers) lets say the add engine command is 12 bits long while the whistle is only 3 bits long, and we have a BER of 0.1 (meaning 10% of bits are sent wrong). That means the chances of sending an individual bit correctly is 90%

This means the chances of sending our whistle command (3 bits) correctly is

(90%) X (90%) X (90%) = 73%. So we have a pretty good chance of getting it right most of the time.

Now our add engine command is

(90%) X (90%) X(90%) X (90%) X(90%) X (90%) X(90%) X (90%) X(90%) X (90%)X(90%) X (90%)   = 28%

So it basically only works about 1/3 of the time.

This is the core reason why the add engine command is more sensitive. It is longer than other commands so the chances of sending it successfully are lower.

=====Repeating the command======

DCS is not stupid and knows when a command is broken or not received, so it will keep trying to send the same command over and over until it works. From our simple example we have a 28% chance of adding an engine successfully, so on average 1 out of 4 times will work. If you flip this around.... that means to make it work correctly, on average the TIU will have to send our add engine command 4 times.  This is why in good conditions you can add a train very quickly, while in bad conditions it may take a very long time. If the DCS system tries to send the same command and fails more than 100 times it just gives up and tells you "engine not on track" or "RF out of range".

==========Okay to real DCS numbers and measurements========== 

Of course if a communication link screwed up 10% of the data it would go to the trash bin. Real DCS is designed to operate at error rates of 1 in 100,000 (BER 10^-5) to 1 in 10 million (BER 10^-7). The real thing to know is how different the length of different commands are.

Here is a direct comparison of the real DCS command for add-engine (my DDA40x on the track) and to blow the whistle.

add_dcs_command

The whistle command is hard to see so here is a zoom in of one of the exchanges:

whistle_command

 

Lets do some basic calculations.

--> DCS runs at roughly 3MHz (It's really more like 3.25 MHz), meaning it sends about 3 bits per microsecond.

--> Each part of the whistle command is about 400us long, meaning it contains about 1200 bits of command data times 2 (for the two parts). That's 2400 bits total per whistle blow.

--> The add engine is 1.7 seconds long or 1,700,000 microseconds. There are idle gaps and it's active somewhere around 30% of the time (similar to the whistle command). So the number of bits is somewhere in the neighborhood of 1,700,000 X 3 bits/us X 30% which is 1,700,000 bits.

Right so lets say we had a fairly reasonable bit error rate of 1 in a million. So 1 out of every million bits sent would be wrong. That means the probability of the whistle working is

(999,999/1,000,000)^2400 = 99.9988% chance of being received in 1 try.

Now the command signal for add engine:

(999,999/1,000,000)^1,700,000 = 18%.

So on average the add engine command will need to repeat about 5 times (18% X 5 is about 100%) to ensure it is exchanged successfully.

 

=====Practical measurements with a DCS system======

So as an experiment I had an attenuator (device that reduces signal voltage) connected between my TIU and test track and slowly dialed down the DCS excursion voltage to 13.5V, 11V, 9.0V, 7.0V, 5.0V, 4.0V and 3.0V. In each case the noise was the same so the SNR is going down with each step. At each voltage setting I tried the add engine command 20 times (yes! that's 140 times and it took all day) and wrote down how long it took, or if it failed to add altogether.

Here is the resulting histogram:

command_test

With a nominal DCS voltage (13V) you can get add times in the 10 second range. At 7.0V you are starting to see delays into the 20 second regime. At 5.0V you're up in the 30-40 second range, and below that you start to see a lot of failures. Note the 3.0V condition failed to transmit the command 18 out of 20 times.

If you look at the figure "SNR vs BER" up at the top, it has an exponential relationship. The DCS add engine delay is also exponential (the difference between 13V and 11V is smaller than the difference between 11V and 9V which is smaller than the difference between 9V and 7V and so on. This exponential behavior shows the underlying BER/SNR behavior of the long add-engine command.

 

=====Take Away======

The longer length (in bits) of the add engine command compared to other commands makes it more prone to errors (and needing repeated transmission) in the DCS system:

Whistle: ~2400 bits

Add Engine: ~1,700,000 bits

 

The time it takes to add engines is set by how many times the system must retry the command before it is successful which is set by the underlying bit error rate, which in turn is set by the system signal-to-noise ratio.

Note: These are statistical measures so you need to retry them a number of times (20 in the above case) to characterize them, as you will always have statistically unlikely exchanges (sometimes a statistically lucky packet may have no errors and add fast).

Attachments

Images (4)
  • SNR_BER
  • add_dcs_command
  • whistle_command
  • command_test
Last edited by Adrian!
Original Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×