Tagged: cinvestav, guest article, SCADE, scade suite, scade test, student
-
-
October 2, 2024 at 2:27 pm
Solution
ParticipantGuest Article – Student – Train Door Operation System with SCADE
This article is a guest contribution from Cinvestav. It was written by a student group as part of Masters-level, semester long SCADE academic program course.
It explains the design and simulation of a system that controls the automatic operation of doors on a train with a focus on passenger safety.
If you are an academic and are interested in teaching an engineering curriculum backed by Ansys tools, please have a look at our Ansys Funded Curriculum page.
Summary
The Automatic Train Door Operation is a train door control system that automatically opens and closes train doors at each station stop. The ATDO system first checks the platform configuration to ensure doors will only be opened at the right places. The system is designed to optimize train dwell time at stations, improve passenger safety, and increase operational efficiency.
The project was designed and developed using the ANSYS SCADE Suite to control the opening and closing of train doors. The system operates in two modes: automatic and manual. The automatic mode is fully system-dependent, while the manual mode requires input from the train operator. The design process involves various activities, which are detailed throughout this document.
System Description
System operation.
The Automatic Train Door System (ATDO) is designed to ensure the safe opening and closing of train doors at stations and during transit. The system operates in two modes: Automatic and Manual.
- Automatic Mode: Activated when the “automanual” signal is high. Doors open automatically when the train is at the station and stopped, six seconds after the doors have closed. They close automatically after 4 seconds if there are no obstructions.
- Manual Mode: Activated when the “automanual” signal is low. The operator controls the opening and closing of the doors using the “openManual” and “closeManual” buttons.
The system employs various sensors and components to obtain the input signals to control the behavior of the system or output the output signals:
- Switches to select the operation mode: automatic or manual.
- Switch to indicate if the train is stopped.
- Limit sensors to detect when the doors are fully open or closed.
- Push buttons to open and close the doors manually.
- Presence sensors, ultrasonic sensor, to detect if there are people or objects obstructing the doors.
- Hall effect sensor used for detecting door closure.
- IR sensor used to detect the presence of the train at the station.
- LED indicators to show the status of the doors (open, closed, closing).
- DC motors to open or close the train doors.
Note: It is possible to use other sensors or elements in addition to the current ones by adapting them in the hardware to send HIGH or LOW signals to the system inputs.
System Behavior
As previously mentioned, this system has two operational modes, the automatic and manual mode.
Automatic Mode
The train doors will remain closed while the train is in motion and not at the station. Upon arrival at a station and coming to a complete stop, the doors will open. The doors will remain open as long as passengers are entering or exiting the train, or if there is an obstruction in the doorways. If no passengers are detected and there are no obstructions, the train doors will begin to close seven seconds after initially opening. Four seconds after the doors start to close, the system will verify whether the doors have closed properly.
If the doors are not detected as closed four seconds after the closure initiation, the system will reopen the doors. The doors will remain open for five seconds after reopening. Once the five seconds have elapsed, the doors will attempt to close again. Four seconds after the doors close, the system will check once more if the doors have closed properly. If not, the process will repeat as described.
Once the doors are detected as closed, the system will permit the train to proceed to the next station.
Manual Mode
In the event of operator discretion or an emergency, the automatic mode can be deactivated and switched to manual mode. The operator will open the train doors using buttons only when the train has come to a complete stop. The operator will then manually close the doors. Once the doors are closed, the train will be permitted to proceed to the next station.
If the doors fail to close, they will automatically reopen four seconds after the initial closure attempt. The operator must manually initiate the door closure process again. If the doors still do not close, this process will be repeated until the doors successfully close.
Once the doors are securely closed, the system will allow the train to proceed to the next station.
System Interface
The following block diagram represents the ATDO system, detailing its inputs and outputs, as well as the data type associated with each of them.
Each input is supplied by one of the sensors selected by the user to monitor the various parameters essential for the operation of the ATDO system.
The outputs control the opening and closing of train doors and provide status indications of their operation.
Software Requirements
The software requirements for the ATDO system are as follows:
REQ_ADO_1:
The “automanual” input shall select Automatic mode when the signal is high and Manual mode when the signal is low.
REQ_ADO_2:
In Manual mode, the system shall activate the DC motors to open the doors when the input signals from the station sensor, the stopped signal and the “openManual” pushbutton are high.
REQ_ADO_3:
In Automatic mode, the system shall activate the DC motors to open the doors when the input signals from the station sensor and the stopped signal are high, 6 seconds after the doors have closed.
REQ_ADO_4:
When the doors are opening, the system shall deactivate the DC motors when the limit switch open signal is high.
REQ_ADO_5:
When the doors are closing, the system shall deactivate the DC motors when the limit switch close signal is high.
REQ_ADO_6:
In Manual mode, the system shall activate the dc motors to close the doors when the “closeManual” pushbutton signal is high.
REQ_ADO_7:
In Automatic mode, the system shall activate the DC motors to close the doors 5 seconds after the doors have opened and the people crossing signal is low.
REQ_ADO_8:
The system shall indicate that the doors are closed through a green LED when the closed doors signal sensor is high.
REQ_ADO_9:
In Automatic and Manual mode, the system shall activate the DC motors to open the doors when the system detects that the closed doors signal sensor is low, 5 seconds after the doors have started closing.
REQ_ADO_10:
In Automatic mode, the system shall activate the DC motors to close the doors again 5 seconds after the closed doors signal is low.
REQ_ADO_11:
The system shall indicate through a yellow LED when the doors are closing.
REQ_ADO_12:
The system shall indicate through a red LED when the doors are opened.
REQ_ADO_13:
The “openManual” and “closeManual” inputs shall remain inactive when Manual Mode is off.
Software Model Description
This section details the software employed in the ATDO system, describing its structure, operators, and their respective signals.
Inputs, Outputs and Data Types
For the system operation, inputs, outputs, and user-defined data types as shown in the following table were utilized. This table describes the name, data type, and possible I/O values connected to the system’s top operator.
Each described system input is originating from signals transmitted by sensors, each designed for specific functionality. Thes signals are pivotal in determining subsequent actions. The outputs of the system serve either to control DC motors or to indicate the current state of the train doors.
NAME
DATATYPE
VALUE
INPUT
autoManual
bool
true/false
INPUT
closedDoors
bool
true/false
INPUT
openManual
bool
true/false
INPUT
atStation
bool
true/false
INPUT
stoppedSignal
bool
true/false
INPUT
closedManual
bool
true/false
INPUT
peopleCrossing
bool
true/false
INPUT
limitSwitchClose
bool
true/false
INPUT
limitSwitchOpen
bool
true/false
OUTPUT
motorA_1
bool
true/false
OUTPUT
motorA_2
bool
true/false
OUTPUT
motorB_1
bool
true/false
OUTPUT
motorB_2
bool
true/false
OUTPUT
states
States
true/false
USERDATATYPES
States
enum
{CLOSE, OPEN, CLOSING}
Call Graph
Find below a call diagram showing the created model operators. “TopATDO” is the root operator, which includes all the operators used on the ATDO system.
Operators
TopATDO Operator
The topATDO node operator is the root operator of the ATDO system. It manages the system’s outputs and inputs to ensure proper operation.
FsmATD Operator
The FsmATD node operator oversees the system’s sequence. The ATDO system is controlled by a state machine with five possible states, which regulates the outputs according to the inputs.
StoppedTrainSensor Operator
The StoppedTrainSensor functional node is used to indicate that the train is stationary, meaning its speed is zero. It features a bool output that depends on the sensor signal.
StationSensor Operator
The StationSensor functional operator is employed to indicate whether the train is at the station. The output signal is high when the input signal from the sensor is high.
Time operator
The Time node operator is a parameterized counter used to initiate transitions after a specified period. It features a HIGH latch state on the output upon completion of the desired cycles.
ConditionCloseToOpen operator
The functional operator ConditionCloseToOpen is used to set a condition to opening the train doors. The output signal of this operator enables the transition to the next state, OPEN, in the control system’s state machine.
PeopleCrossing operator
PeopleCrossing functional operator detects the presence of individuals or objects crossing the train doors, allowing the doors to close when no presence is detected. The output signal is high when the input signal from the sensor is high.
MotorsController Operator
The MotorsController functional operator is used to control the DC motors that perform the opening and closing of the train doors. The output signals of this operator are connected to the motors, controlling their direction according to the required action.
ConditionOpenToClosing operator
The ConditionOpenToClosing functional operator is used to set a condition to closing the train doors. The output signal of this operator enables the transition to the next state, CLOSING, in the control system’s state machine.
ClosedDoors operator
The ClosedDoors functional operator is employed to indicate within the system whether the train doors are in a closed state. The output signal is HIGH when the signal from the closed doors sensor registers as HIGH.
Verification
Testing
An important part of this project is the testing, to verify the optimal operation of the system. A procedure called “TEST_FINAL” was created with two records, one represents the manual operation of the system and the other one the automatic operation of the system.
In each record, the modes of operation are tested respectively, based on the software requirements for each mode of operation.
Automatic Operation Mode:
Manual Operation Mode:
After running the tests, we can ensure that the scenarios described in each of them are met.
Coverage
After completing the tests, we need to check that all possible scenarios our system may encounter are covered. In this case, the top module achieves 100% coverage, but we can find some gaps in certain operators within the system.
Implementation
The system implementation is via physical application. In this application uses the next components list:
- Arduino Mega 2560.
- Two limit Switches.
- Two switches.
- Two push buttons.
- IR sensor
- Hall Effect Sensor Module SS49E.
- Ultrasonic sensor (HC-SR04)
- Two DC motors.
- L298N Dual H-bridge Motor Driver Controller.
- LEDS: Green, Red and Yellow.
These components and sensors are used for the input and output signals of the ATDO System. The image below shows the physical implementation of the system.
Results
The ATDO system successfully performed its function in both the SCADE simulation and physical implementation for the automatic opening of train doors. The system’s development presented various challenges, which were progressively resolved. However, some gaps in coverage were identified due to certain conditions not being met in specific states.
Designing any critical embedded system requires time and dedication, from project proposal and requirements to final implementation. SCADE significantly facilitates this process by generating code that simplifies development. Nevertheless, ensuring that the proposed requirements comprehensively cover the entire system behavior and that the physical implementation elements align with the system design remains crucial.
The project highlighted the importance of thorough testing and validation to achieve complete coverage and reliability, especially in safety-critical applications such as train door automation. Continuous refinement and verification against real-world conditions are essential to ensure the system’s robustness and safety.
Feedback on MBD and SCADE
Model-Based Design (MBD) and the Safety Critical Application Development Environment (SCADE) are essential tools in the development of critical systems, providing a robust platform for the simulation and verification of designs before implementation. These tools enhance the reliability and safety of the ATDO system by allowing thorough testing and validation of software components.
About the authors
Anette Mora Palascencia has recently graduated from the Centro Universitario de Ciencias Exactas e Ingenierías in México with a degree in Engineering in Communications and Electronics (2024). Her interests include emdedded systems development, digital systems and learning software design.
Livier Guadalupe García Hernández has recently graduated from the Centro Universitario de Ciencias Exactas e Ingenierías México with a degree in Engineering in Communications and Electronics (2024). Her interests include embedded systems development and learning new technologies.
-

Introducing Ansys Electronics Desktop on Ansys Cloud
The Watch & Learn video article provides an overview of cloud computing from Electronics Desktop and details the product licenses and subscriptions to ANSYS Cloud Service that are...

How to Create a Reflector for a Center High-Mounted Stop Lamp (CHMSL)
This video article demonstrates how to create a reflector for a center high-mounted stop lamp. Optical Part design in Ansys SPEOS enables the design and validation of multiple...

Introducing the GEKO Turbulence Model in Ansys Fluent
The GEKO (GEneralized K-Omega) turbulence model offers a flexible, robust, general-purpose approach to RANS turbulence modeling. Introducing 2 videos: Part 1 provides background information on the model and a...

Postprocessing on Ansys EnSight
This video demonstrates exporting data from Fluent in EnSight Case Gold format, and it reviews the basic postprocessing capabilities of EnSight.
- Scade One – Bridging the Gap between Model-Based Design and Traditional Programming
- How to Verify a Model on Host with SCADE Test? (Part 4 of 6)
- Scade One – An Open Model-Based Ecosystem, Ready for MBSE
- Scade One – A Visual Coding Experience
- Introduction to the SCADE Environment (Part 1 of 5)
- Using the SCADE Python APIs from your favorite IDE
- Scade One – Democratizing model-based development
- How to integrate multiple SCADE models into one executable
- How to Generate Code with SCADE Display (Part 6 of 6)
- ANSYS SCADE – Map Iterator – Comparison Function: C and SCADE Methods Comparison (Part 4 of 4)
© 2025 Copyright ANSYS, Inc. All rights reserved.