Most model railroad applications of LEDs require a "dropping" resistor.
LEDs are rated by Forward Voltage at max milli-amps (fV@mA). This is the maximum voltage that can be safely applied to the LED to produce maximum brightness and the amount of power it will consume at that brightness.
Forward Voltage is the spec we need to worry about. Milli-Amps simply tells us how much of our available power the device will consume.
Forward Voltage is adjusted by adding a "dropping resistor" to reduce the input voltage to a safe working level.
For example, the rated output of your command station is 14.5V at the rail. The LED is rated at 3.2fV. We need to reduce the voltage by 11.3V to prevent damage to the light.
The exact formula looks something like:
R = (VS - VF) / I
where:
R = Resistor Value (Ohms)
VS = Supply Voltage (Volts)
VF = LED Forward Voltage (Volts)
I = LED Current (Amps)
In model railroad applications, maximum brightness is not necessary. Safe operation on any layout, maximum life for minimal maintenance and replication of the headlight effect are the most desirable characteristics.
Generally speaking, a 1000 ohm resistor will protect the LED on any Z, N, or HO layout. This is my default size as it accomplishes all of me primary goals.
A 1k resistor will protect a 3.2fV LED up to about 21V Supply Voltage. At 21 volts, we could match the scale speed of the record setting 385 mph run of the French TGV!
Adding a higher-value resistor will make the LED dimmer. This is effective for marker and passenger car lights where dimmer is usually better. I usually keep 1k, 5k and 10k resistors available for adjusting brightness. The only limit to adding resistance is when the LED will no longer produce light.
The by-product of adding resistance is heat however. It is important to size the resistor properly so as not to generate excessive heat that might damage your shell or create other problems.
Again, the exact formula looks something like:
P = I² × R
where:
P = Power (Watts)
I² = LED Current (Amps)
R = Resistor Value (Ohms)
Doing the math, that 1000 ohm resistor will disipate 0.128 Watts of power when used with a 3.2fV LED at 14.5 Vs.
Generally speaking, a 1/8 or 1/4 watt resistor will protect the LED on any Z, N, or HO layout. This is my default size as it accomplishes all of me primary goals. The larger the value, the cooler the resistor will operate.
Of course, the easy way to experiment with this is to use any one of a thousand online calculators to see the effect of resistance on current and watts.
Here is a link to one of my favorite resistor calculators:
The Best Current Limiting LED Calculator