A model train. Marklin 3rail
That gives some problems. I want to do it with ac power.
This is the motor.
Now it's controled by a transformer. It's reversed by sending 20V to the motor. Then a magnet switches the contact so the power to the motor is reversed.