ExpressLRS / Handset

Handset Development
GNU General Public License v3.0
31 stars 7 forks source link

Dynamic power based on RSSI and LQ #12

Closed JBKingdon closed 3 years ago

JBKingdon commented 3 years ago

Adjusts the power of the TX based on RSSI and LQ from telemetry packets. When using dynamic power the power level set on the radio is treated as the maximum to be used, and the actual power will be reduced from that according to the signal strength at the receiver.

Enable by adding #define USE_DYNAMIC_POWER to user_config.h

The thresholds and filter speed are set via #defines in main.cpp

DYN_POWER_INCREASE_MARGIN - relative to the rsSensitivity of the current packet rate mode DYN_POWER_DECREASE_MARGIN - relative to the above threshold DYN_POWER_LQ_THRESHOLD - LQ below which power will be gradually increased DYN_POWER_LQ_PANIC_THRESHOLD - LQ below which power will be set directly to configured max DYN_POWER_MISSED_TELEM_PACKET_THRESHOLD - The number of consecutive missed telemetry packets that will trigger a transition to the configured max power DYN_POWER_RSSI_FILTER_CUTOFF_HZ - The filter cuttoff frequency for smoothing the RSSI values. Smaller values will produce a slower response when reducing power. Increases in power happen immediately.