CS452 - Real-Time Programming - Winter 2013

Lecture 25 - Multi-Train Control II

Public Service Annoucements

  1. When you will give the second demo

Train Control Demo I

What we saw

  1. All groups had calibration of constant speed
    • Precision varied: pm 3mm to pm10cm
    • Comprehensiveness varied.
  2. Most groups did not have reversing routes. (3 & 4 are needed to make this work well.)
  3. Most groups did not have acceleration/deceleration calibrations.
  4. Most groups could not stop between sensors.
  5. Many groups started off by finding the train.
  6. Many groups stopped tracking the train when they gave a stop command
    • Internal to your application every active train should have, at all times, values that are your best estimates of its velocity and position.
  7. Some groups kept track of train direction.
  8. Some groups relied on operating reliably at low speed, which is risky.
  9. One group found the slow then crawl method of stopping.
  10. One group found a scaling relationship that helped them a lot
  11. Few groups had parametrized applications.
    • parameters that are changeable at the terminal which your application is running
    • giving a demo
    • learning more while debugging when performance matters
    • example, time and safety margins when reversing through a switch might be adjustable
  12. Most groups had noticed that measurement is very time-consuming.
  13. Few groups had dynamic calibration
    • new-v = (1 - a) * old-v + a * measured-v: simple as it is this works very well
    • save for next use on a linux disk, start with the most recent save next time
  14. Most demos were too highly weighted to route finding, compared to calibration.
    • route-finding is the easy part.

Not having a wide enough state space in which you know where trains are will probably hurt you the most going forward.


Multi-Train Control

By the end of the week-end you should be able to drive one train on the track, knowing exactly where it is.

By the following milestone you will be able to control two trains at the same time. For each train

  1. the train finds itself
  2. you give it a destination: a destination is a location on the track
  3. the train starts travelling toward the destination
  4. it reaches the destination without colliding with the other train
  5. both trains move at the same time

A good goal for the second train milestone is

Sensor Attribution

Collision Avoidance

Route Finding

It doesn't seem to matter what shortest path algorithm you use, but

Reservations: a possible solution to collision avoidance

You have to be able to look ahead.

To do so treat the track as a divisible resource like pixels on a display. Train driver requests some of the resource in order to move.

A very simple way to do it not well enough

  1. Train driver gets a request to do something with the train, and figures out whither he needs to move.
  2. Train driver asks for a route
  3. Train driver is blocked until no other train is moving.
  4. Train driver requests track all the way to the end of the route.

Return to: