CS 452/652 Winter 2022 - Lecture 19
February 18, 2022
prev next
Track/Train Measurements
- train control assignments need velocity information
- preparatory measurements can be taken without full kernel
- start early before the tracks fill up!
- default turnout setting - use trap loops: small (left/right), medium, large
- middle turnouts: do not set to C/C! (can lead to derailment)
Data Representation
- word length 32 bits
- no floating point!
- if necessary, use fixed-point integer instead
- if necessary, use 64-bit 'long long' integers to hold temporary results during computation
Metrics
- time
- fastest clock: 508 kHz
- 32 bit can represent > 2 hours ⇒ sufficient
- location, distance
- millimetre granularity sufficient
- longest short path (without reverse): ~10.5m
⇒ 32-bit integer sufficient
- keep in mind: size of train, location of pickup!
- velocity
- distance in mm; velocity in mm/s
- distance/velocity? fraction of second → scale up / rearrange
- example: travel time in ticks for 10ms ticks
- distance / (velocity / 100)
- (distance / velocity) x 100
- compute: (distance x 100) / velocity
Speed / Velocity
Basics
- speed: train setting 0-14
- velocity: actual travel distance per time
- non-linear with speed
- different for different trains
- different for different parts of track?
- changes over time (wear and tear)
- handle at least 1. and 2. by measuring and storing velocity data
- offline experiments → start now!
- continuous online measurements?
- data import/export?
Sensor Measurement
- assume ~70ms continuous sensor polling loop
- unknown (hopefully constant) measurement error
- train controller box
- signal latency
- etc.
- variable measurement error: sensor trigger relative to polling loop → 0-70ms
- processing delays? later... (should be small with dedicated measurement program)
Speed Measurement
- velocity = distance / (stop - start)
- constant error in 'stop' and 'start' cancels out
- maximum variable error: up to 2x 70ms = 140ms
- at speed of 0.5m/sec, this corresponds 7cm
- use averaging (and deviations) to deal with uncertainty
- to be revisited...