|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The beep detector: hysteresis on the current above its idle floor, pulse and gap lengths judged in readings, groups split by silence. More...
#include <esc_stick.h>
Data Fields | |
| esc_stick_timing_t | t |
| uint8_t | long_equals_short |
| bool | counting |
| bool | seeded |
| int32_t | floor_x16 |
| bool | have_prev |
| uint32_t | prev_ms |
| uint32_t | iv_max_ms |
| bool | high |
| uint32_t | rise_ms |
| uint32_t | last_high_ms |
| uint32_t | before_rise_ms |
| uint32_t | n_high |
| bool | stuck_told |
| bool | wait_quiet |
| bool | quiet_known |
| uint32_t | quiet_from |
| bool | busy |
| uint32_t | busy_from |
| bool | fell |
| uint32_t | fall_ms |
| uint32_t | n_low |
| bool | group_open |
| bool | group_bad |
| uint8_t | shorts |
| uint8_t | longs |
| uint8_t | count |
| bool | valid |
The beep detector: hysteresis on the current above its idle floor, pulse and gap lengths judged in readings, groups split by silence.
Lengths come from readings, so they are known to one reading interval. A pulse or gap is judged short when it holds fewer readings than the shortest beep or gap must hold at the longest interval seen; a pulse is judged long from the time between its first and last reading, which is never longer than the beep. A group with any pulse or gap judged wrong, or with a late reading inside it, is heard but not valid.
Counting starts on a quiet line: after esc_det_count() no group opens until GROUP GAP of quiet has passed, so the first group heard is a whole one and not the tail of a group already under way.
| bool esc_det_t::busy |
not quiet while waiting
| uint32_t esc_det_t::busy_from |
when the line was last busy, ms
| bool esc_det_t::counting |
else only the floor is tracked
| uint32_t esc_det_t::fall_ms |
first low reading after a pulse
| bool esc_det_t::fell |
a pulse has ended (fall_ms is set)
| int32_t esc_det_t::floor_x16 |
the idle current, mA x 16
| bool esc_det_t::have_prev |
whether prev_ms holds a reading time
| uint32_t esc_det_t::iv_max_ms |
longest interval not late
| uint8_t esc_det_t::long_equals_short |
0: every beep is short
| uint32_t esc_det_t::n_low |
consecutive low readings since the pulse ended
| uint32_t esc_det_t::prev_ms |
bench time of the previous reading, ms
| uint32_t esc_det_t::quiet_from |
the quiet began here
| bool esc_det_t::quiet_known |
whether quiet_from is set
| bool esc_det_t::seeded |
whether floor_x16 has its first reading
| bool esc_det_t::wait_quiet |
no group opens until a quiet gap