Skip to content

fix(firmware): track the quiet floor continuously instead of latching at boot - #1821

Open
clonea1 wants to merge 1 commit into
ruvnet:mainfrom
clonea1:contrib/adaptive-floor
Open

fix(firmware): track the quiet floor continuously instead of latching at boot#1821
clonea1 wants to merge 1 commit into
ruvnet:mainfrom
clonea1:contrib/adaptive-floor

Conversation

@clonea1

@clonea1 clonea1 commented Sep 4, 2026

Copy link
Copy Markdown

calibration_update() averages the first EDGE_CALIB_FRAMES frames and latches
the result for the lifetime of the boot. That cannot be made to work: the node
is calibrating in the seconds right after a human walked over and plugged it
in, so the window is contaminated by construction, and nobody can leave a room
fast enough to fix it. Whatever the room looked like during that one minute
becomes "normal" permanently, and a node commissioned during a busy afternoon
stays desensitised for weeks.

A leaky minimum needs no clean room and no cooperation. It drops instantly to
any new low, so it finds the quiet by itself whenever quiet next happens --
minutes after a bad start rather than never. It climbs only slowly, so a
genuine change in the room is eventually adopted while a person standing still
for a while is not mistaken for the new floor.

if (motion < s_floor) s_floor = motion;        /* descend at once */
else                  s_floor *= EDGE_FLOOR_LEAK;

The warm-up is kept, but only to seed a plausible starting value rather than to
latch one.

Measured support for the shape, on a nine-node ESP32-C6 fleet: the room's true
floor sits about 14x below where household animals register, and the settling
period after human activity runs a couple of hours. A tracker that descends to
real quiet and climbs at well under a percent a minute resolves that; an
average over one arbitrary minute cannot.

Separated by hand from a larger local change rather than cherry-picked -- the
same file also carries 256-bin HE20 subcarrier support and a vitals-slots
packet, which are unrelated and are not included here.


Rebased onto current main before opening: staged before today's seven merges, so it needed replaying to avoid reading as a revert of them. Clean rebase, no files deleted.

… at boot

calibration_update() averages the first EDGE_CALIB_FRAMES frames and latches
the result for the lifetime of the boot. That cannot be made to work: the node
is calibrating in the seconds right after a human walked over and plugged it
in, so the window is contaminated by construction, and nobody can leave a room
fast enough to fix it. Whatever the room looked like during that one minute
becomes "normal" permanently, and a node commissioned during a busy afternoon
stays desensitised for weeks.

A leaky minimum needs no clean room and no cooperation. It drops instantly to
any new low, so it finds the quiet by itself whenever quiet next happens --
minutes after a bad start rather than never. It climbs only slowly, so a
genuine change in the room is eventually adopted while a person standing still
for a while is not mistaken for the new floor.

    if (motion < s_floor) s_floor = motion;        /* descend at once */
    else                  s_floor *= EDGE_FLOOR_LEAK;

The warm-up is kept, but only to seed a plausible starting value rather than to
latch one.

Measured support for the shape, on a nine-node ESP32-C6 fleet: the room's true
floor sits about 14x below where household animals register, and the settling
period after human activity runs a couple of hours. A tracker that descends to
real quiet and climbs at well under a percent a minute resolves that; an
average over one arbitrary minute cannot.

Separated by hand from a larger local change rather than cherry-picked -- the
same file also carries 256-bin HE20 subcarrier support and a vitals-slots
packet, which are unrelated and are not included here.

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant