Digital Signal Processing Reference
In-Depth Information
8 State Machine Design: The Electric Train Controller
8.1 The Train Control Problem
The track layout of a small electric train system is shown in Figure 8.1. Two
trains, we'll call A and B, run on the tracks, hopefully without colliding. To
avoid collisions, the trains require a safety controller that allows trains to move
in and out of intersections without mishap.
For safe operation, only one train at a time can be present on any given track
segment. The track layout seen in Figure 8.1 is divided into four track
segments. Each track segment has sensors that are used to detect trains at the
entry and exit points.
In Figure 8.1, there are two Trains A and B. As an example, assume Train A
always runs on the outer track loop and Train B on the inner track loop. Assume
for a moment that Train A has just passed Sensor 4 and is near Switch 3 moving
counterclockwise. Let's also assume that Train B is moving counterclockwise
and approaching Sensor 2. Since Train B is entering the common track (Track
2), Train A must be stopped when it reaches Sensor 1, and must wait until Train
B has passed Sensor 3 (i.e., Train B is out of the common track). At this point,
the track switches should switch for Train A, Train A will be allowed to enter
Track 2, and Train B will continue moving toward Sensor 2.
The controller is a state machine that uses the sensors as inputs. The
controller's outputs control the direction of the trains and the position of the
switches. However, the state machine does not control the speed of the train.
This means that the system controller must function correctly independent of
the speed of the two trains.
Switch 3
A
Track 1
B
Track 3
Sensor 5
Sensor 1
Sensor 2
Sensor 3
Sensor 4
Track 4
Track 2
Switch 1
Switch 2
Figure 8.1 Track layout with input sensors and output switches and output tracks.
 
Search WWH ::




Custom Search