Commit 9582cea
Ravi Singh
fix(motion): debounce direction chip — 10 cm/s threshold, 200 ms commit
The Live tab's direction chip (still / closer → / away →) was flipping
every 200 ms or so even when the target was stationary. Cause: the
Kalman direction logic used a 4 cm/s velocity threshold + a 3-tick
(60 ms) hysteresis, which is far below the LD2450's noise floor.
Breathing-level sway easily crossed 4 cm/s, the chip flipped, layout
felt twitchy.
- Velocity threshold raised 4 → 10 cm/s. Whatever the radar's noise
floor is, the velocity threshold needs a healthy multiple over it;
10 cm/s gives ~5x headroom over LD2450's ±5–10 cm position noise
amplified to velocity by the Kalman filter.
- Direction commit count raised 3 → 10 ticks (motion task @ 50 Hz, so
60 ms → 200 ms). 200 ms feels deliberate, doesn't lag for genuine
movement, but rejects breathing/sway-level blips.
- PI mode threshold also bumped 4 → 10 cm/s. PI has no agreement-count
hysteresis (legacy v5 path), so threshold is the only knob there.
Bench-tested on the same C3 + LD2450: chip now sits stably on "still"
during normal standing-around behaviour, flips to "closer →" / "away →"
within ~200 ms of a deliberate step.1 parent f6a43ef commit 9582cea
2 files changed
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
| 136 | + | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
0 commit comments