Hardware lab 06 · Analog timing input
A paddle becomes a time interval.
Turn the potentiometer, discharge the capacitor, and count clock ticks until an analog voltage crosses a comparator threshold.
RC timing bench
- CAPACITOR
- 0.000 V
- TIMER COUNT
- 0
- IDEAL CROSSING
- 15.915 ms
- QUANTIZED
- 15915 ticks
- DERIVED ANGLE
- 135.00°
Keyboard: ←/→ turn one degree · Space trigger · P pause · N step · C instant capture
Physical circuit
Nominal values are what the schematic promises. Error sliders represent the actual component landing somewhere inside its tolerance band.
- ACTUAL R
- 519.70 kΩ
- ACTUAL C
- 44.18 nF
- TIME CONSTANT τ
- 22.960 ms
- TOLERANCE SHIFT
- -3.21%
Timer and discharge path
The comparator is analog, but the recorded result is discrete: the first timer edge after the crossing.
- TIMER TICK
- 1.00 µs
- COUNT RANGE
- 0–65535
- QUANTIZATION ERROR
- 0.10 µs
- DISCHARGE
- 113.2 τ
Timing fits the counter, discharge is complete, and useful count resolution remains.
Teach software what 0° and 270° count like.
Turn fully counterclockwise, capture, then store the minimum.
Turn fully clockwise, capture, then store the maximum.
Counts between the endpoints interpolate to a calibrated angle.
- MINIMUM
- —
- MAXIMUM
- —
- STATUS
- EMPTY
- ANGLE METHOD
- COMPONENT MODEL
Calibration check
Select a target, turn the paddle, then capture. Try to land within ±2° using only the timer-derived angle.
Recent captures
| # | Shaft | Actual R | Ideal time | Count | Quantization | Derived angle |
|---|---|---|---|---|---|---|
| No measurements yet. Trigger the discharge cycle. | ||||||
What the hardware is really doing
- The controller does not send an angle. It changes a resistance.
- The capacitor converts resistance into elapsed time through an exponential voltage curve.
- A comparator turns the analog threshold crossing into one digital edge.
- The timer rounds that edge to a whole number of clock periods.
- Part tolerances and threshold variation move the count even when the shaft does not move.
- Endpoint calibration absorbs much of that unit-to-unit variation into software.