Skip to content

Conversation

@jgromes
Copy link
Owner

@jgromes jgromes commented Dec 17, 2025

As described in #1628, this PR adds the following:

  • Public method SX126x::setOutputPower(int8_t power, uint8_t paDutyCycle, uint8_t hpMax, uint8_t deviceSel) which gives users lower-level control over the PA
  • Lookup tables with optimized PA configuration, saving 25 - 30% power consumption during transmission. The optimization is enabled by default, but can be disabled by setting the second argument of setOutputPower to false.

@jgromes jgromes added the enhancement New feature or request label Dec 17, 2025
@jgromes jgromes linked an issue Dec 17, 2025 that may be closed by this pull request
@jgromes jgromes marked this pull request as draft December 17, 2025 20:01
@serialrf433
Copy link

It is interesting to see how about every measured, optimized dBm value rised a small fraction while the power draw got reduced.

The unoptimized values are more or less linear. The optimized have some anomalies between -1dBm and 5dBm.

https://github.com/radiolib-org/power-tests/blob/main/logs/compare_sx1262/rlb_2025_12_14_084954.log

@jgromes
Copy link
Owner Author

jgromes commented Dec 19, 2025

optimized dBm value rised a small fraction while the power draw got reduced

@serialrf433 that is the result of the optimization algorithm: https://github.com/radiolib-org/power-tests/blob/71e2b9e361886192c0794365dfc3af42784a43b1/py/process.py#L78

I identify the "correct" output value not by the absolute level, but by comparing with the output of the unoptimized version for that level. This is to guarantee that our updated configuration always produces the same or slightly better result than the unoptimized version. For example, the real output for an unoptimized version of +15 dBm is approximately +14.84 dBm. The algorithm searches for settings that produce at least +14.84 dBm or more, and from those it selects the one with the smallest power draw.

The optimized have some anomalies between -1dBm and 5dBm.

I noticed those too, but they seem to be aligned with the unoptmized samples. For example, notice how the sample below drops for both unoptimized and optimized version. Because of this I think it is some error in the measurement (and also why during the verification I measured each point 10 times, as can be seen in the sources).

   -1,                     -0.01,          3.31,       2.89,      28.94,     95.68                      0.20,          3.31,       2.03,      20.34,     67.29
   -1,                     -0.19,          3.31,       2.89,      28.92,     95.63                     -0.15,          3.31,       2.03,      20.34,     67.27
   -1,                     -0.00,          3.31,       2.89,      28.91,     95.58                      0.20,          3.31,       2.03,      20.36,     67.35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PA Optimal Settings configuration option for SX1262?

3 participants