The Purpose of this lab was to create a software program in MATLAB that can control a train set. The motivation behind this lab was to create a code that included options to change variables that can effect delay times and the speed of the train depending on if it is in a rural or urban setting. This lab is relevant to the scientific community because it accounts for traffic and safety around a train track and can help scientist and engineers create a system that is the safest and the most efficient.
First, the speed of the train was tested with the sensors being unobstructed. This returned a value of 77 consistently. Then the sensors were obstructed, returning a value of 412. As the motor speed increased, the train speed increased, and the time it took for the train to go around the track decreased.
There are many possible sources of error for this lab. One source of error is the unpredictability of cars and drivers. The train is set through MATLAB to run infinitely until it is turned off by the user. This means it does not account for potential blockage on the track. For example, if a car were to have an engine failure, or try to go around the gate and beat the train, if the car is on the track the train will not stop. A possible solution to this problem is allotting more time for the cars to get through before the train passes the crossing, such as slowing the train even more in an urban setting. Another potential source of error for this experiment is the landscape. The train could need to change speeds to account for the track or uneven topography. A solution to this can be to adjust the software by basing it off uneven topography.
This lab generated the knowledge necessary to create a software program that corresponds with the Arduino. Using loops and functions that MATLAB has incorporated into it’s program, a customizable software was created that can be adjusted to fit the clients needs.