Steps
A step transforms a value on its way through a pipeline. A pipeline names one with op:,
which is both the directory below and the crate name, with no suffix.
There are 7 steps in the tree.
| Step | Takes | Produces | Configuration |
|---|---|---|---|
cadence | any | same as input | every, mode |
fan-curve | f32 | PwmDuty | in_min, in_max, out_min, out_max |
hysteresis | f32 | DigitalState | on_threshold, off_threshold |
max-value | f32 | f32 | - |
min-value | f32 | f32 | - |
moving-average | f32 | f32 | window |
threshold-trigger | f32 | ThresholdAlarm | threshold, fire_below |
Each step in detail
cadence
Cadence a path: pass one of every every samples, controlling how often the downstream
(typically an Outlet) is recomputed and written. On the ticks between samples it either drops
the value (Decimate) or re-emits the last sampled value (SampleHold). Type-transparent
(generic over the value it carries), so it declares no fixed input/output type.
Type-transparent: it declares no fixed input or output type and passes through whatever it carries.
Configuration
| Field | Where it is set | Type | Default |
|---|---|---|---|
every | pipeline | u32 | 1 |
mode | pipeline | CadenceMode | Decimate |
fan-curve
Feed-forward transfer function mapping an input reading (e.g. temperature) to a PWM duty via a linear curve, clamped to the output range. Drives a PWM Outlet directly. Threshold/hysteresis's continuous counterpart — no PID.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | command | PwmDuty |
Configuration
| Field | Where it is set | Type | Default |
|---|---|---|---|
in_min | pipeline | f32 | 0.0 |
in_max | pipeline | f32 | 100.0 |
out_min | pipeline | f32 | 0.0 |
out_max | pipeline | f32 | 1.0 |
hysteresis
Two-threshold hysteresis controller for feed-forward actuator control. Turns ON when the input
rises to/above on_threshold and OFF when it falls to/below off_threshold, emitting a
DigitalState only on a transition (edge). Drives a digital Outlet directly.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | command | DigitalState |
Configuration
| Field | Where it is set | Type | Default |
|---|---|---|---|
on_threshold | pipeline | f32 | 0.0 |
off_threshold | pipeline | f32 | 0.0 |
max-value
Running maximum: keeps the largest value seen so far and emits it on every sample, so the output is monotonically non-decreasing. Seeded at negative infinity, so the very first sample is always its own maximum: there is no warm-up, and the step always emits, never nothing. Unconfigurable and time-independent, with no window, decay or reset, so a single outlier pins the output high for the lifetime of the pipeline.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | max | f32 |
Configuration
No configuration.
min-value
Running minimum: keeps the smallest value seen so far and emits it on every sample, so the output is monotonically non-increasing. Seeded at positive infinity, so the very first sample is always its own minimum: there is no warm-up, and the step always emits, never nothing. Unconfigurable and time-independent, with no window, decay or reset, so a single outlier pins the output low for the lifetime of the pipeline.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | min | f32 |
Configuration
No configuration.
moving-average
Arithmetic mean over a sliding window of the last window samples, summed afresh from a ring
buffer on every sample so no running accumulator can drift. Emits nothing at all until the
window has filled: the first window - 1 samples yield no value, and every sample after that
yields the mean of the most recent window. It never emits a partial-window average or a
placeholder, so anything downstream is simply not updated during the warm-up, and once filled
it never returns to that state. window is silently clamped to 1..=64, so 0 becomes 1 (each
sample passed through as its own average) and anything above 64 becomes 64.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | average | f32 |
Configuration
| Field | Where it is set | Type | Default |
|---|---|---|---|
window | pipeline | usize | 8 |
threshold-trigger
Edge-triggered threshold alarm. Emits one ThresholdAlarm on each transition into the trigger
region and nothing otherwise, neither while the input stays there nor when it leaves, so there
is no cleared event and a consumer cannot learn from this step when the condition ends.
Re-entering fires again, and with no hysteresis band or dwell time an input dithering across
the threshold re-fires on every crossing (use hysteresis where that matters). fire_below
picks the side: false (the default) makes the region value > threshold, true makes it
value < threshold. Both comparisons are strict, so a sample equal to threshold never
fires. The step starts inactive, so a first sample already inside the region counts as a
transition. The alarm carries the sample that fired it and the configured threshold.
| Name | Type | |
|---|---|---|
| in | value | f32 |
| out | alarm | ThresholdAlarm |
Configuration
| Field | Where it is set | Type | Default |
|---|---|---|---|
threshold | pipeline | f32 | 0.0 |
fire_below | pipeline | bool | false |