CS452 - Real-Time Programming - Spring 2009
Lecture 24 - Calibration
Controlling a Train
Types of Control
Ballistic Control
Feedback Control
Summary
The sensors give us large granularity feedback control.
Between the sensors we must use ballistic control,
- which depends on integrating the train speed over time.
Calibration
Based on
- using knowledge of the past to predict the future
Methodology
- Measure the train's speed
- Assume that the future will be like the past
- Then the speeed of the train under the same condition will be the same
in the future
Measuring Speed
The easy part
- Get time at sensor N
- Get time at sensor N+1
- Calculate speed between the sensors using
- distance between sensors
- difference between times
Collect many such measurements
Using a Calibration
The other easy part
- Arrive at sensor N at time t
- Use clock server to label sensor event with time
- Look up velocity to use in calibration table
- Position at time t' is sensor position + velocity x (t' - t)
Building a Calibration Table
The hard part.
Two things are hard.
- Dealing with measurement error
- Two categories of error
- Systematic = controllable
Examples,
- measurement lag
- Assume average lag is always the same
- Calculating time intervals works fine
- Calculating actual position at a specific time needs a
lag added
- How do you find out the lag?
curved versus straight
Solution
- Subdivide the data
- But not too much
- Random = uncontrollable
Examples,
- variations in measurement lag
Level of random error determines ultimate accuracy of
calibration
Solution
- Take more measurements
- But without consuming much time
Rule of thumb
- Many measurements, simple algorithm works better than
- Few measurements, complex algorithm
- Determining what state is relevant
State is has many potentially relevant aspects
- train speed
- which train it is
- curved versus straight versus switch
- previous speed
- time since last speed change
- cleanliness of track
- time since last maintenance of train
Practical Issues
- You are already doing a whole lot of measurements
- Average in a circular buffer
- Size & align table by size & alignment of cache lines
Return to: