More or less....
An attempt at a very simple non technical explanation......
Starting with the transformer speed controller, set direction (personal choice as to whether one chooses forward or reverse) set speed dial for desired level.
The Relay, for those familiar with a DPDT Reversing switch will recognise the similarities in the drawing above, the subtle difference is in the way the "IN" and "OUT" are connected, with a manual switch you the operator physically move the switch, in this instance is is done electronically.
For simplicity sakes will use the contacts "NC" as forward and the contacts "NO" as reverse, or could be reverse and forward.
Track connections BLUE and RED, these can be either one or the other, as in one will be POS the other will be NEG, depending on which way the Relay has been set.
The two diodes, again for simplicity refer to them as detectors, and as above they will either be conducting as POS or NEG.
The Brains is the Quad NAND Gate, which responds to what occurs with the diodes.
So for simplicity at the "A" end, the BLUE wire is POS, upon the Engine passing the diode, a pulse will be triggered to 1 of 4 of the INPUTS to the NAND Gate, which in turn will then activate the Relay, say for argument's sake the contacts will move from "NC" to "NO"
Likewise if the BLUE wire is NEG, upon the Engine passing the diode, a pulse will be triggered to 2 of 4 of the INPUTS to the NAND Gate, which in turn will then activate the Relay, say for argument's sake the contacts will move from "NC" to "NO"
Same and repeat at the "B" end, BLUE wire POS 3 of 4 of the INPUTS to the NAND Gate, and activate the Relay.
"B" end, BLUE wire NEG 4 of 4 of the INPUTS to the NAND Gate, and activate the Relay.
Phew.............