GithubHelp home page GithubHelp logo

railroad_crossing's Introduction

[English](README.adoc) | [日本語](README_ja.adoc)

Railroad Crossing Model for STAMP/STPA Simulation

In this repository, we provide assembly diagrams and programs for a railroad crossing constructed with LEGO MINDSTORMS EV3 kit and additional LEGO blocks. This railroad crossing can be operated alongside the LEGO City Train (and together with EV3_Train: https://github.com/kuboaki/ev3_train).

Motivation

The STAMP/STPA [stamp_stpa] handbook [handbook1] provided by IPA [ipa] includes a case study on railroad crossings. However, this case study is limited to descriptions on paper. We thought that having a physical model to experiment with could aid in understanding hazards and other factors. Since testing with real trains is impractical, we decided to develop this system by creating LEGO block versions of the described railroad crossing and train for experimentation.

Overview of the System

This system involves two actors:

  • Train

    • This is a standard LEGO City Train controlled by a remote.

  • Railroad Crossing

    • This is a simple railroad crossing as described in the handbook. It includes a locking rods, warning lights, and sensors to detect train passage.

railroad crossing real set oval
Figure 1. Overall view of the environment using EV3 kit and additional blocks
railroad crossing real set center
Figure 2. Close-up of the railroad crossing section:
railroad crossing set 01 cernter wired
Figure 3. Overall view for simulation system

Train

For the train, we used a remote-controlled "LEGO City Train" kit.

The train is operated using a remote control typically provided with LEGO City Trains. I used the “Lego City 60198 Cargo Train” locomotive and freight car, but others will do.

Cargo Train
Figure 4. Locomotive and freight car

It can be controlled wirelessly for forward, backward, and stop operations, with variable speed options.

remote controller
Figure 5. Wireless controller

Railroad Crossing

The railroad crossing was constructed using LEGO Mindstorms EV3 and other LEGO parts.

The components of this crossing are as follows:

  • Blocking unit (Blocking rods and their controllers)

  • Warning lights (replaced with EV3 body LEDs)

  • Warning Sound (replaced with EV3 sound)

  • Train passage monitoring unit

  • Manual switch for operating the blocking unit

Note
This railroad crossing model is based on a case study introduced in the STAMP/STPA handbook provided by IPA. It may differ from real railroad crossings, as it was not created based on research of actual railroad crossings.

Blocking unit

Blocking unit consists of a Blocking rods and a motors that moves it.

railroad crossing gate 01
Figure 6. Blocking unit

Train passage monitoring unit

The unit uses color and ultrasonic sensors to check for passing trains.

railroad crossing checker 01
Figure 7. Train passage monitoring unit(Color sensor ver.)
railroad crossing detector 01
Figure 8. Train passage monitoring unit(Ultrasonic sensor ver.)

Manual switch for operating the blocking unit

Touch sensor is used for the switch that manually operate the blocking unit.

manual switch
Figure 9. Manual switch

Building Instructions

Building instructions are not provided, but you can gain insights from the .io files in the images directory (these are data from Bliklink Studio).

build instruction on studio
Figure 10. Bricklink Studio screen showing blocking unit building instructions

Development Environment

The system is built using TOPPERS/EV3RT (Real-Time platform for EV3) and programmed in C language. For details about the development environment, refer to the EV3RT website.

The version of EV3RT used in this project is "1.1-release." If you intend to run it on older environments, adjustments may be needed in certain parts such as timer precision and configuration file formatting. It’s recommended to update to version 1.1 and adjust the code accordingly. Of course, it should also work well with other programming languages that support EV3.

Note
For simulation using a miniature environment, refer to hakoniwa_simulation.md.

Content Structure

railroad_crossing
├── images: LEGO Studio, Blender, png
├── models: system design model(uml)
└── railroad_crossing01: codes for railroad crossing

Building the Program

Clone this repository into the EV3RT workspace

$ cd {installed location}/ev3rt-1.1-release/hrp3/sdk
$ git clone https://github.com/kuboaki/railroad_crossing.git

Build the railroad crossing program

Go to the railroad_crossing directory and build the railroad crossing program railroad_crossing01.

Warning
Be careful that the directory you build is not railroad_crossing01!
$ cd railroad_crossing
$ pwd
{installed location}/ev3rt-1.1-release/hrp3/sdk/railroad_crossing
$ make app=railroad_crossing01
$ ls -l app
-rw-r--r--  1 kuboaki  staff  102204  8  9 17:48 app

Transfer the created app file to EV3 for the crossing. See the EV3RT website for transfer instructions.

Running the System

(Images …​)

Operating the Train

(Explanation of train composition and operation.)

Operating the Railroad Crossing

(Explanation of railroad crossing operation procedures.)

Testing STAMP/STPA Cases

(Reproduce and operate the cases presented in the STAMP/STPA examples.)

References

railroad_crossing's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.