bluerobotics / ping-firmware

Repository for binary files associated with ping devices
5 stars 8 forks source link

Auto gain feature is surprisingly slow #24

Open ES-Alexander opened 1 year ago

ES-Alexander commented 1 year ago

When using the auto gain feature the incoming ping stream becomes quite jerky, and and the maximum data rate slows significantly. Ideally auto gain would consume negligible time, especially when the return confidence is high - if it's getting a strong response then it's unlikely it would need to change anything.

As some numbers, on my desk the received data with auto mode on is at ~2kB/s, and manual mode with exactly the same setup is at ~6kB/s. Some amount of slowdown may be reasonable, but a 3x performance hit is quite unexpected, particularly given the confidence is at 100% so the scan range is barely changing. This seems likely to be a bug.

https://user-images.githubusercontent.com/25898329/198422334-74ec0992-e132-4e10-bdf8-0e6ec015ed2b.mov