The beta is open — sign up →
Blog/Tutorial/Blocks and detection: stopping a train in the right place with a single detector
Tutorial

Blocks and detection: stopping a train in the right place with a single detector

One block, one detector, and the train still stops in the middle of the platform: how LocoPilote computes the stop, and what makes it accurate.

Frédéric
Frédéric

Creator of LocoPilote

26 October 2026

📖 7 min read

A locomotive running on a layout plan divided into blocks

For software to drive your trains, it has to know where they are. On a layout, this information comes from blocks and their detectors. This guide explains what a detector really sees, why a train sometimes stops at the entry of the block instead of the middle of the platform, and how LocoPilote gets a precise stop without wiring one more detector.

What is a block?

A block is a section of track, electrically isolated from its neighbours by rail gaps, where only one train runs at a time. A detector tells the software whether the block is occupied or free.

This information makes everything else possible: reserving a route, turning a signal red behind a train, or preventing two trains from entering the same block.

A layout plan divided into five blocks, with a locomotive running (labels in the screenshot are in French)
LocoPilote's sample plan: five blocks (Station track 1, Station track 2, East, North, West).

What a detector sees

There are two main families of detectors, and they do not answer the same question.

  • The zone detector, the most common, measures the current drawn in the block. It says “a train is here”, over the whole length. It does not say where: at the start, the middle or the end of the block, the answer is the same. A wagon that draws no current stays invisible, unless it has resistive axles.
  • The point detector (reed switch, infrared barrier, Hall-effect sensor) says “a train has passed here”, at a precise point. Between two passes, it knows nothing.
ℹ️ What to remember

A zone knows that a train is there, not where it is. A point knows where the train passed, not whether it is still there.

The problem: where to stop?

With a single zone detector per block, the only known moment is when the train enters the block. If you tell the train to stop as soon as it is detected, it stops at the entry: at the end of the platform, barely in the station.

This is how LocoPilote behaves for a block declared as Single zone: the stop happens at the entry, because there is no other known place. The block window says so in plain words (Layout tab, Block tool, then click the block name and Configure, Detectors tab).

Detectors tab of a block in the Single zone plan: one band over the whole length, a single detector (labels in the screenshot are in French)
Single zone: we know a train is there, not where.

The solution with no extra hardware: the computed stop

The entry into the block is a precise instant. From there, if you know the train's speed, you know where it is: at 20 cm/s, it has covered 20 cm after one second. All that is left is to tell it at what distance to stop.

This is the Zone + stop point plan: the same single detector, plus a stop distance that you declare. LocoPilote computes when to slow down and when to cut power, so that the train stops at that distance from the entry. No extra detector to install.

Detectors tab of a block in the Zone + stop point plan: the declared distance and the targeted stop (labels in the screenshot are in French)
Zone + stop point: no detector at the stop point, the run is computed.

On the sample plan, the two station tracks are set up this way: stop at 33.6 cm from the entry, in both directions. The other blocks stay in single zone. The Block states window (Layout tab) summarises these settings for the whole layout.

Block states window: plan, length and stop point of each block (labels in the screenshot are in French)
The two station tracks in “Zone + stop point”, the other blocks in “Single zone”.
⚠️ Computed, not detected

No detector checks where the train stops: accuracy depends on what the software knows about each locomotive. The next two settings make all the difference.

What makes it accurate

Each locomotive's speed profile

Two locomotives set to the same speed step do not run at the same speed. To compute a stop, LocoPilote therefore has to know each machine's real speed, step by step: this is its speed profile.

In the locomotive's sheet, Speed profile tab, the Start an automatic measurement button does the job: the locomotive runs back and forth on its own, step by step, over a section of three blocks. You can also enter speeds you measured by hand.

Speed profile tab of a locomotive's sheet, with the Start an automatic measurement button (labels in the screenshot are in French)
The automatic measurement of the speed profile.

Two tips from our testers' trials:

  • measure with the decoder's inertia set to zero (CV3 and CV4), as the screen reminds you, to measure the motor's raw response;
  • measure again if you change the decoder's speed settings: the old profile no longer matches.

The detection offset

With some detectors, the locomotive is only seen once it is well inside the block, depending on where it picks up current, and not at the moment its front crosses the gap. For one of our testers, a locomotive was only detected once it was entirely inside: its front was already 21 cm past the gap. All its stops therefore landed about 21 cm too far.

The Detection offset setting, in the same tab, corrects this: it is the distance between the block entry and the front of the locomotive at the moment the block turns occupied.

The Detection offset frame in the Speed profile tab (labels in the screenshot are in French)
The detection offset is set locomotive by locomotive.

To measure it: approach a block by hand, very slowly, stop the locomotive as soon as the block turns occupied on screen, then measure from the entry gap to the front of the locomotive.

The four detection plans

Each block is declared according to what is really installed on it, in the Detectors tab of its window. LocoPilote offers four plans, each with its own drawing:

The four detection plans offered in a block's window (labels in the screenshot are in French)
A band = a detector that monitors the whole length; a dot = a detector that monitors a point.
PlanWhat you haveWhat you getIts limit
Single zoneOne detector for the whole blockThe train is seen continuously, from entry to exitIt stops at the block entry
Zone + stop pointThe same detector, plus a declared distanceThe train stops where you decidedThe stop is computed: it depends on the speed profile
Point at each endA point detector at each endThe entry is seen at an exact point: the stop is more accurateBetween the two passes, the state of the block is unknown
Free configurationYour detectors where they are, zone optionalEach detector gets its role, direction by directionWithout a zone, occupancy stays unknown between the points
💡 Unknown is not free

A block equipped only with point detectors does not know whether a train is in it between two passes. For LocoPilote, its state is then unknown, never “free”.

Where to start?

  1. Declare each block's plan. If you have one current detector per block, that is the Single zone.
  2. Measure the speed profile of the locomotives that need to stop precisely.
  3. Switch to Zone + stop point the blocks where the stop matters (platforms, sidings) and declare the distance.
  4. Set the detection offset of each locomotive.
  5. Check with a tape measure where the train stops, and correct the distance or the offset if needed. From the Block states window, the Measurement assistant helps you measure the detector position and the stop point with a running locomotive.

You can do all these trials without hardware, in trial mode: that is what the article Getting started with LocoPilote shows.

Happy running!

Share:
Frédéric

Frédéric

Creator of LocoPilote

Developer and railway modeller, creator of LocoPilote. Passionate about automating model railway layouts.

Related articles