RoR Smoothing Guide
RoR is the heartbeat of your roast: it tells you whether the beans are accelerating toward first crack or slowing down into a stall. To keep this curve both stable and responsive, remember three ideas. First, probe noise must be filtered. Second, smoothness and responsiveness always pull against each other. Third, HiBean calculates RoR through a three-stage pipeline: optional temperature pre-filtering, the main RoR algorithm (LWMA or Polyfit), and a post-processing smoother. Once you understand this flow, you can dial in a reliable curve with minimal fiddling.
1. Why bother smoothing?
During roasting, the BT probe is shaken by airflow, bean agitation, and sampling jitter. If you derive RoR directly from raw BT, the curve often spikes ±5–10 °C/min in a single second. Multi-run simulations show that a RoR curve without any smoothing captures instant changes but buries the true trend under noise; applying a light moving average cuts the spike range by roughly 10–15 %, making the moments around first crack clearly visible. In other words, smoothing is about trustworthy decision signals—not “prettier” charts.
1.1 How do we quantify smoothness and responsiveness?
- Smoothness – We compute a sliding standard deviation on RoR, normalize it against the unsmoothed baseline, and clamp it to 0–1. Higher means fewer short-term jitters.
- Responsiveness – We measure how much the smoothed curve lags behind the raw curve at the key turning point and convert it with
response = exp(-|lag| / 12s). Values near 1 react quickly; lower scores mean noticeable delay. - Overall score –
0.55 * smoothness + 0.45 * response. This weighting comes from HiBean’s in-house testers, who slightly prioritize a steady curve but still care a lot about reaction time.
How is the lag obtained? We take the same roast data, generate two RoR series (raw and smoothed), and run a short low-pass filter on each to avoid mistaking noise for a trend. Then we search for the first time the curve crosses zero from negative to positive—when RoR swings from falling to rising. If a zero crossing doesn’t exist, we fall back to the minimum RoR value. The time difference dt between the raw and smoothed turning points is the lag, which feeds the exponential formula above. That directly answers, “How many seconds later does the smoothed curve react?”
2. Smoothness vs. responsiveness: the eternal trade-off
Every slider is a tug-of-war between “calm” and “fast.” Larger windows or heavier weights average more history, so the line is steadier but also slower. With Polyfit’s standard preset, raising the post-smoothing window from 1 (off) to 4 (deadband EMA) adds roughly 6–8 s of lag for only ~0.04 smoothness gain. LWMA shows the same pattern: turning on temperature pre-filtering with a window of 4 costs about 3 s of reaction time. Decide whether you need immediacy or serenity first, then tune accordingly.
3. RoR processing pipeline
| Stage | Default | Purpose | Key settings |
|---|---|---|---|
| Temperature pre-smoothing | Off | Lightly filter BT before calculating RoR (moving average or EMA) | Toggle, algorithm, window/α |
| Core RoR algorithm | On | Turn BT into RoR via LWMA (decay average) or Polyfit | Algorithm choice + preset level or custom values |
| Post RoR smoothing | On | Clean up the RoR output with a final filter | Moving Average / Butterworth / Deadband EMA + window |
Out of the box, HiBean keeps BT pre-smoothing off to avoid irreversible latency, lets you choose LWMA or Polyfit with low/medium/high presets, and adds a gentle post-smoother to tame remaining noise. Only enable the first stage when your probe noise is beyond what the tail-end filters can cope with.
4. When should you enable temperature pre-smoothing?
Using Polyfit (standard preset) with post-smoothing disabled, “Off” delivers the best overall score (0.696). Switching the moving-average window to 2 increases smoothness by ~0.02 but adds a full second of lag; pushing it to 8 or dropping EMA α to 0.25 roughly doubles latency. So the benefit of pre-smoothing is usually smaller than its cost.
Enable it only when:
- Probe noise is extreme (e.g., loose sensor, dusty environment) and post filters can’t stabilize the curve.
- You are debugging hardware, trying to understand the raw sensor behavior before comparing RoR algorithms.
Even then, keep the window ≤ 2 or EMA α ≥ 0.7. If you need more noise suppression, raise the post-filter instead of stacking delay upfront.
5. LWMA or Polyfit?
| Factor | Polyfit | LWMA (Decay Average) |
|---|---|---|
| Principle | Fits a polynomial trend over a sliding window with optional prediction offset | Applies temperature decay weights on each sample for a rolling average |
| Responsiveness | Lower lag at low/medium presets, great for spotting trend shifts | Naturally stable but typically 2–5 s slower than Polyfit at the same level |
| Tuning | Multiple knobs (window, lag, prediction offset, output smoothing) for fine control | Primarily one decay weight, easier mental model |
| Test takeaway | Low preset (post off) leads the pack; standard + Butterworth is the sweet spot | Shines at high smoothness when paired with Deadband EMA |
Rule of thumb:
- Need to see changes around first crack quickly? Choose Polyfit.
- Prefer a rock-solid line with fewer knobs? Choose LWMA.
- Unsure? Start with Polyfit standard, then use LWMA as a cross-check.
6. The three smoothing presets
| Algorithm | Level | Typical use | Core parameters | Post filter |
|---|---|---|---|---|
| Polyfit | Low | Tuning, chasing instant feedback | window = 5, lag = 10 s, offset = –1 s | Moving average window = 1 (off) |
| Polyfit | Standard | Daily roasting default | window = 10, lag = 18 s, offset = 0 | Butterworth window = 3 |
| Polyfit | High | Demos or noisy environments | window = 10, lag = 30 s, offset = –1 s | Deadband EMA window = 4 |
| LWMA | Less | Fast feedback with LWMA flavor | temp decay = 6 | Moving average window = 1 |
| LWMA | Medium | Similar feel to Polyfit standard | temp decay = 10 | Butterworth window = 3 |
| LWMA | High | Maximum calmness | temp decay = 16 | Deadband EMA window = 4 |
Simulations show Butterworth (window 3) and Deadband EMA (window 4) sit on the Pareto frontier: they balance latency and noise suppression while keeping the implementation lean.
7. Custom parameters explained
Tackle settings in this order: lock in the responsiveness you need → tweak the core algorithm → only then decide if pre/post filters are necessary.
7.1 Temperature pre-smoothing
- Toggle – Off by default. Once enabled, every subsequent stage runs on a slower-moving BT signal, so the delay cannot be undone downstream.
- Algorithm – Moving average is intuitive (“longer window = smoother”). EMA uses α (0–1) to control how much the latest sample weighs in; the larger the α, the faster the reaction.
- Moving-average window – Each extra step roughly adds one second of lag while improving smoothness by ~2 % (based on the Polyfit standard preset).
- EMA α – Dropping from 0.9 to 0.3 makes the curve dull but dramatically increases lag. Staying at 0.7 or above keeps latency manageable.
7.2 LWMA (Decay Average)
- Temperature decay weight – Range 2–20. Higher values emphasize history and yield a steadier but slower curve. Lower values hug the raw RoR. Presets sit at 6 / 10 / 16.
- RoR post filter – Choose moving average, Butterworth, or Deadband just like the presets. Feel free to reuse the preset combos or tailor them to your beans.
- Post moving-average window – Only applies when the post filter is
movingAverage. Window = 1 means “off”; anything above 1 adds lag linearly with the window size.
7.3 Polyfit
- Fitting window length – Controls how many BT samples form each polynomial fit. Larger windows are calmer but slower. 5–15 is a practical range.
- Lag (seconds) – Think of it as sliding the fitted curve forward in time. Higher lag observes longer-term trends; lower lag reacts faster.
- Prediction offset – Compensates for roaster-specific bias (ms). Negative values pull the curve forward; positive values push it back.
- Output smoothing window – A lightweight moving average applied after Polyfit. Window = 1 outputs the raw fit; larger windows add a final polish.
- RoR post filter + window – Same three filters as LWMA. Butterworth window 3 and Deadband window 4 are the recommended bases.
8. Typical scenarios
- Fastest response (manual adjustments) – Turn off BT pre-smoothing, choose Polyfit Low or LWMA Less, and keep the post filter at moving average window 1.
- Everyday roasting / profile replay – Polyfit Standard + Butterworth(3). It consistently scores on the Pareto frontier for both algorithms.
- Very noisy probe or “presentation mode” – Pick either algorithm’s High preset with Deadband EMA window 4. If noise still dominates, cautiously enable BT pre-smoothing with window 2.
- Hardware or filter experiments – Disable every helper (pre window 1, post window 1) to see the raw RoR, then reintroduce filters one by one.
9. Sample test data
The table below comes from the same roast dataset evaluated through different smoothing combinations (RoR period 60 s, sampling 1 s, BT pre-smoothing off). Use it to see how noise reduction and lag rise together:
| Configuration | Smoothness | Lag (s) | Responsiveness exp(-|lag| / 12s) | Overall | | --- | --- | --- | --- | --- | | Polyfit Low + Post Off | 0.780 | 4.18 | 0.70 | 0.746 | | Polyfit Standard + Butterworth(3) | 0.793 | 6.40 | 0.59 | 0.700 | | Polyfit High + Deadband(4) | 0.807 | 14.82 | 0.29 | 0.575 | | LWMA Less + Post Off | 0.803 | 5.12 | 0.65 | 0.735 | | LWMA Medium + Butterworth(3) | 0.836 | 10.39 | 0.42 | 0.649 | | BT pre MA window 2 (Poly Standard) | 0.810 | 7.23 | 0.54 | 0.692 | | BT pre MA window 8 (Poly Standard) | 0.840 | 14.55 | 0.30 | 0.596 |
The trend is unmistakable: pushing any smoothing parameter upward always improves smoothness but inevitably increases lag. Choose the level that matches how early you need feedback during a roast.
