DCC digital command are now common.
Though, for simple rail network, the classical analogic automatic control, based upon magnet detection, still deserve some interest in terms of cost and relative simplicity (if few loops are installed).
This page does not aim to replace the required documents from LGB (general catalogue 'the world of LGB' and also the book LGB track planning and technical guide), here are the very basics of analogic automation with LGB (or alternatives) equipment for a network running in analogic mode.
Alternative current (AC) or continous current (DC) for control ?
LGB controls are based upon an inlet in alternative current and equipment (motors) in continuous current. This allow using diodes to simplify schematic and control. It is though fairly doable to use continuous current (DC) to control switch motors, with sufficient voltage for neat operation.
switches (points, turnouts, etc.)
Present LGB switches (not the oldest) have two wire connections. When current flowing in one direction, motor goes one way, while reversing current flow, motor goes the other way. The current shall never be permanently maintained in these switches, that shall destroy them.
Contacts controlled by magnets
Magnets are installed below the locomotives and permit (among others possibilities):
The magnet passage close a magnetic contact 'Reed' type. The LGB contacts (1700 et 17100) are no longer available and could be replaced with those. Thes contacts are equipped of slecting diodes and have three wire connections. Central connection is common wire (white/grey)in AC. The two others connections are polarised contact. Any weather proff reed contact associated with a pair of diodes could do the job.
A pair of magnet could be found at Massoth under the reference 8420102.
Logic and relays
On switch motors, you could add contacts for track power supply control or others motor or signal control.
Below you shall find the simplest circuit with two reversing loops. The train shall always go in the same side of the loop (if you wish to go the other way, you shall reverse polarities at the switch motor connections). Beware of first start, as the switches shall be in appropriate position. If you want to run either way, more magnetic contacts are required.
Timer and shuttle mode.
See the timer relay LGB 55063 HERE (or ref Massoth 8155001)
The drawback is that you need a DCC programmer to define the parameters of this module.
The control is done with magnets installed in the track and two magnetic switches in the loco (one magnet position tell to stop, the other magnet position tell to return. Example: one magnet positioned in the middle, the other on the side). It is a quite low price module at 42 £. You are free to get power from track or from batteries.
Heathcote electronics (UK) propose a simple shuttle module.