During the completion of the ECED 4402: Real Time Systems course, I built a Python application using the Tkinter GUI library, which was created to control a model train set. The application showed the current location of the train and allowed for directing the train to any of a total of twenty-four stations. The routing to these stations may involve flipping one of the six railroad switches in the network. This map functioned by creating a serial connection to the control program running on a Tiva C Series ARM Cortex LaunchPad. A screenshot of this application is shown below.
View this project on GitHub.
To determine the location of the train, hall effect sensors were positioned under each of the twenty-four stations. These sensors are placed between the railway tracks and operate by detecting a nearby magnetic field. These sensors are capable of detecting when a train arrives at each station, either forward or backward. The sensor from station #8 is shown below.
To ensure proper and safe functionality of the train control, several tests were performed. These tests were designed both to test individual functionality of the system, as well as a full integration of the entire system.
Hall Effect Sensor Detection
The purpose of the first test is to verify the hall-effect sensors properly communicate with the train controller firmware, which ultimately communicates with the train machine & map program. To test the hall-effect sensors, a magnet was used to manually trigger individual sensors. Sensors #1 through #4 was sequentially triggered to verify the position of the train on map properly reflects the triggered sensor.
The second test that was performed was to direct the train from station #16 to station #15. These stations were chosen due to their close proximity, leading to a short yet important test of several key systems. This test ensured proper functionality of starting the train, detecting the train, and stopping the train. A recording of this test can be found below:
The third test that was performed was to ensure the train machine was capable of differentiating between different hall effect sensors when they are triggered and to act accordingly. The train was initially stationed at station #15 and station #13 was chosen as the destination. A recording of this test can be found below:
Flipping Railroad Switch
The fourth test that was performed was to ensure proper operation and control of a railroad switch. In this test, switch #4 was flipped to change the track network from a station #6-#5 connection to a station #6-#18 connection. A recording of this test can be found below:
The fifth and final test that was performed was an integration test of all of the individual systems. In this test, the origin of the train was station #1 and the destination was station #23. To complete this journey, switch #1 must be configured to allow for a station #14-#13 connection and switch #2 for a #12-#11 connection. Then, the train is sent off in the clockwise direction until arriving at station #10. Upon arrival, switch #2 can be safely flipped to connect stations #11-#23. The train is then sent in the counter-clockwise direction until arriving at the final destination. A recording of this test can be found below: