Change in osmo-bts[master]: power_control.c: Limit speed of announced MS Power Level value changes

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Nov 20 19:25:39 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/16142 )


Change subject: power_control.c: Limit speed of announced MS Power Level value changes
......................................................................

power_control.c: Limit speed of announced MS Power Level value changes

It's not a good idea to request big changes in MS Power based on
sporadic bad signal received, let's instead change announced MS power
levels more smoothly to avoid possible big signal strength fluctations,
similar to what is already done in osmo-bts-trx specific loop (loops.c).

Related: OS#1851
Change-Id: Iecc4ec7e21471ec853ad2d5659af4052aba5444c
---
M src/common/power_control.c
M tests/power/power_test.c
2 files changed, 20 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/16142/1

diff --git a/src/common/power_control.c b/src/common/power_control.c
index d08ed5e..d2a6c1d 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -30,6 +30,11 @@
 #include <osmo-bts/measurement.h>
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/power_control.h>
+
+/* how many dB do we raise/lower as maximum (1 ms power level = 2 dB) */
+#define MS_RAISE_MAX_DB 4
+#define MS_LOWER_MAX_DB 8
 
  /*! compute the new MS POWER LEVEL communicated to the MS and store it in lchan.
   *  \param lchan logical channel for which to compute (and in which to store) new power value.
@@ -51,10 +56,6 @@
 	if (lchan->ms_power_ctrl.fixed)
 		return 0;
 
-	/* How many dBs measured power should be increased (+) or decreased (-)
-	   to reach expected power. */
-	diff = bts->ul_power_target - rxLevel;
-
 	current_dbm = ms_pwr_dbm(band, ms_power);
 	if (current_dbm < 0) {
 		LOGPLCHAN(lchan, DLOOP, LOGL_NOTICE,
@@ -70,6 +71,18 @@
 		return 0;
 	}
 
+	/* How many dBs measured power should be increased (+) or decreased (-)
+	   to reach expected power. */
+	diff = bts->ul_power_target - rxLevel;
+
+	/* don't ever change more than MS_{LOWER,RAISE}_MAX_DBM during one loop
+	   iteration, i.e. reduce the speed at which the MS transmit power can
+	   change. A higher value means a lower level (and vice versa) */
+	if (diff > MS_RAISE_MAX_DB)
+		diff = MS_RAISE_MAX_DB;
+	else if (diff < -MS_LOWER_MAX_DB)
+		diff = -MS_LOWER_MAX_DB;
+
 	new_dbm = current_dbm + diff;
 
 	/* Make sure new_dbm is never negative. ms_pwr_ctl_lvl() can later on
diff --git a/tests/power/power_test.c b/tests/power/power_test.c
index 30fbb64..0e08f0b 100644
--- a/tests/power/power_test.c
+++ b/tests/power/power_test.c
@@ -64,8 +64,10 @@
 
 	/*
 	 * Now 15 dB too little and we should power it up. Could be a
-	 * power level of 7 or 8 for 15 dBm
+	 * power level of 7 or 8 for 15 dBm. However, since we limit peace at
+	 * which we change values, expect several steps of MS_RAISE_MAX_DB/2 levels:
 	 */
+	apply_power_test(lchan, -90, 1, 11);
 	apply_power_test(lchan, -90, 1, 7);
 
 	/* It should be clamped to level 0 and 30 dBm */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/16142
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iecc4ec7e21471ec853ad2d5659af4052aba5444c
Gerrit-Change-Number: 16142
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191120/6290087d/attachment.htm>


More information about the gerrit-log mailing list