Amin Rahimi - Schoolwork - Train Dispatcher

The class:

ECE 191 is an engineering group design course meant to give students some real-world engineering experience. Students divide into groups of three or four and are assigned to a specific project sponsored by a company in San Diego. Each team is assigned a mentor from the company to help the students get started and provide help with any technical issues the team might have.

The course entails weekly Powerpoint presentations in front of the class. The studends give updates on the status of the project as well as any new solutions or approaches that the team may have developed. Presentations include agenda, Gantt chart, a “tasks performed” slide, technical slides, and summary slides.

Throughout the course, students are expected to keep an updated documentation of the project. The final documentation is to be turned in in the form of a technical user’s manual, rather than a history, discussing topics pertinent to the project.

 

The project:

Among the various wonderful museums in San Diego’s Balboa park lies the lesser known model railroad museum in the basement of Casa de Balboa. The museum boasts several exhibits, including that of the San Diego Society of N-Scale. This is a 160:1 scale representation of the railroad system running through the San Diego area, complete with running model passenger and freight.

The museum, which had been running the system on 386 machine realized that they needed to update to a more modern computer and run a program written in a modern language. A group in the quarter before ours was therefore assigned to replace the outdated (and lacking) PASCAL code with more powerful Java code.

The new code was capable of both reading from and writing to individual blocks on the track (see How the track works) as well as providing a graphical user interface that to closely follow CTC conventions.

The code, however, had several shortcomings. A block would often be read as being occupied even if no trains were present on the track. When attempting to set a throttle value, we found that most or all of the turnouts would unexpectedly throw. The user interface did not have adequate indicators showing which trains were present on which block. Most importantly, the code did not have any kind of automation (all throttles had to be set manually).

 

The following is our statement of work. These are the tasks that were assigned (and completed):

Automatic operation: (my job)

  • A generalized decision algorithm will be developed to allow unsupervised train operation with collision avoidance.
  • Trains will run according to their definitions.
    • Passenger trains will enter the San Diego Depot on the passenger side.
    • Freight trains will enter the San Diego Depot from the freight side.
  • A train identification algorithm will be written to allow the computer to track all trains.
  • The system will allow for trains more than one block in length.

User operation:

  • The operator will be able to start or stop a single train’s operation at any time.
  • GUI will clearly display all trains and their positions on the track
  • Re-definition of trains will be possible during operation (train type, preferred velocity).

Error reporting:

  • The software will write a log file to disk that records the errors with a time stamp.
  • All error messages will be informative.

Remote access:

  • A user from a remote computer will be able to access the system.
  • Access will be passworded and protected.
 

The result:

The computer was able to run multiple trains on the track with absolutely no collisions or gridlock. The trains were able to set throttle speeds and turnout positions without any interference issues. The GUI accurately and concisely displayed the train positions as the dispatcher ran. The trains were able to successfully pull into turnouts while oncoming trains passed and then resume operation once the path was clear.

This is a video of the program running. Two trains are set to approach each other on the same track. One enters the turnout and waits as the other passes, then resumes operation.

TrainVideoDIVX.avi

 

For details on the project, please read the final report.