T1A1: Important Thoughts

a) a real-time system

The railway is a real-time system because it is a reactive system were the environment causes and dictates the interaction.

Furthermore there are real time constrains for reaction time of the system because a delayed reaction may cause an accident.

b) an embedded system

The railway controller needs special hardware, protocols and embedded processors to interact with components.

It does not need any keyboard or display to run and function correctly.

So it is not a standalone system for a desktop PC but a an embedded system integrated into to the railway.

c) a safety-critical system

It is a safety-critical system because most failures will directly endanger environment and hence people in and around the train.

So if the system crashes or hangs up the environment will not stop as well, so each error has safety-critical aspects.

T1A2: C Interface

Plan

1. Leave KH_ST_1

  • Set point 8 straight and 9 to branch
  • Power KH_ST_1 and KH_ST_6 forward with 60

2. Pass KIO_LN_1


    • Power KIO_LN_1 foward with 60

3. Goto inner circle and enter IC_ST_1


    • Set point 27 & 28 straight
    • Set point 29 to branch
    • Set point 24 straight
    • Power OC_ST_0 foward with 60
    • Power IC_ST_4 reverse with 60
    • Power IC_ST_1 reverse with 60

4. Slow down


    • Wait for contact 1 of IC_ST_1 triggered
    • Power IC_ST_1 reverse with 20

5. Stop and wait


    • Wait for contact 0 of IC_ST_1 triggered
    • Brake on IC_ST_1
    • Wait 5 sec

6. Leaving IC_ST_1 to outer circle


    • Set point 20 straight
    • Set point 16, 17, 18 to branch
    • Power IC_ST_1 reverse with 60
    • Power IC_ST_0 reverse with 60
    • Power OC_ST_4 foward with 60

7. Pass KIO_LN_1


    • Power KIO_LN_0 foward with 60

8. Enter KH_ST_1


    • Set point 0 and 1 to branch
    • Set point 2, 3, 4 straight
    • Power KH_ST_0 foward with 60
    • Power KH_ST_1 foward with 60

9. Slow down


    • Wait for contact 0 of KH_ST_1 triggered
    • Power KH_ST_1 forward with 20

10. Stop and wait


    • Wait for contact 1 of KH_ST_1 triggered
    • Brake on KH_ST_1
    • Wait 5 sec

11. Continue at 1.

Code

T1A2_Controller.c

T1A3: Reality vs. Simulation

1. Differing Expectations

There were no real initial expectations (preventing disappointments).

But I expected modelGUI and controller-simulation to be a bit more stable in cases of restarts after recompiling.

2. Expected differences between the simulation and the real model railway
  • Reactions to e.g. speed changes will not be immediate in the real model railway as they are in the simulation due to physical processes.
  • No all trains will have the same behaviors in cases of speed, acceleration and breaking. Each real engine will behave a bit different.
  • Unreliable triggering contacts causing inaccuracies in calculation of speed or direction of triggering train.
  • Simulation can proceed with errors. On the real model railway an illegal configuration of tracks will cause a short shot or derail. In the simulation such errors are indicated as e.g. E_MOTORMODE_MISMATCH or E_SPEED_MISMATCH but may have no effect on the simulation.
  • It is possible to have high acceleration in simulation even if real trains may fall apart.

 

Tags: