Change in osmo-ttcn3-hacks[master]: BTS_Tests: add TC_ms_pwr_ctrl_pf_ewma: test EWMA based power filtering

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon Oct 19 18:08:33 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20727 )

Change subject: BTS_Tests: add TC_ms_pwr_ctrl_pf_ewma: test EWMA based power filtering
......................................................................

BTS_Tests: add TC_ms_pwr_ctrl_pf_ewma: test EWMA based power filtering

This test case is very similar to TC_ms_pwr_ctrl_constant(), but the
key difference that we simulate sharp UL RSSI changes between -50 dBm
and -100 dBm on each iteration.

The 'uplink-power-target' (-75 dBm) is right in the middle of the
change range, so with EWMA filtering and 80% smoothing it's expected
that all averaged UL RSSI values would be around -75 dBm.

It's expected that the Uplink power level remains constant, however
this test case fails at the moment.  The problem is that the IUT is
still quite sensitive to small deviations from 'uplink-power-target',
so ideally we should introduce a 'hysteresis' defining a range:

  ['target' - 'hysteresis' ... 'target' + 'hysteresis']

in which the MS power loop should not trigger any power changes.

For example, let's say:

  'uplink-power-target' is -75 dBm (default), and
  'hysteresis' is 8 dBm,

so then the range would be: -83 dBm ... -67 dBm.

Change-Id: I3be1a4a4a0ab7eebb9a930eee7039295c045a791
Depends: Iacedbd4d69d3d74e2499af5622a07a8af0423da0
Related: SYS#4916
---
M bts/BTS_Tests.ttcn
1 file changed, 75 insertions(+), 0 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 6fc396d..4128406 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -106,6 +106,7 @@
 	integer mp_ms_actual_ta_exp := 0;
 	integer mp_timing_offset_256syms_exp := 512;
 	integer mp_uplink_power_target := -75;
+	integer mp_uplink_power_hysteresis := 8; /* -83 .. -67 */
 	/* Time to wait for RSL conn from BTS during startup of test */
 	float mp_ipa_up_timeout := 15.0;
 	float mp_ipa_up_delay := 0.0;
@@ -6922,6 +6923,19 @@
 	return f_TC_ms_pwr_ctrl_cb_def(l1h, num_blocks);
 }
 
+private function f_TC_ms_pwr_ctrl_cb_rssi_pwm(inout SacchL1Header l1h, integer num_blocks)
+runs on ConnHdlr return octetstring {
+	/* UL RSSI oscillation driven by SACCH block number */
+	if (num_blocks rem 2 == 0) {
+		f_trxc_fake_rssi(-100);
+	} else {
+		f_trxc_fake_rssi(-50);
+	}
+
+	/* Make sure that MS power level remains constant */
+	return f_TC_ms_pwr_ctrl_cb_const(l1h, num_blocks);
+}
+
 /* Make sure that MS power level remains constant when 'rx-current' equals 'rx-target' */
 private function f_TC_ms_pwr_ctrl_constant(charstring id)
 runs on ConnHdlr {
@@ -6979,6 +6993,66 @@
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
+/* Test Exponentially Weighted Moving Average (EWMA) power filtering */
+private function f_TC_ms_pwr_ctrl_pf_ewma(charstring id)
+runs on ConnHdlr {
+	var integer num_blocks := 16;
+	timer T := int2float(num_blocks);
+
+	f_l1_tune(L1CTL);
+	RSL.clear;
+
+	/* These IEs are needed for autonomous MS power control */
+	var template (value) RSL_IE_List ies := {
+		t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{
+			 ms_power := ts_RSL_IE_MS_Power(g_pars.l1_pars.ms_power_level)
+		}),
+		t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{
+			 ms_power_params := ts_RSL_IE_MS_Power_Parameters(''O)
+		})
+	};
+
+	/* Ensure that 'rx-current' equals 'rx-target' */
+	f_trxc_fake_rssi(mp_uplink_power_target);
+
+	/* Establish a dedicated channel */
+	f_est_dchan(more_ies := valueof(ies));
+
+	L1CTL.clear;
+	T.start;
+	alt {
+	[] as_TC_ms_pwr_ctrl(refers(f_TC_ms_pwr_ctrl_cb_rssi_pwm), num_blocks);
+	[] T.timeout {
+		setverdict(fail, "Not all SACCH blocks were processed in time, ",
+				 num_blocks, " were not handled");
+		}
+	}
+}
+testcase TC_ms_pwr_ctrl_pf_ewma() runs on test_CT {
+	var ConnHdlr vc_conn;
+	var ConnHdlrPars pars;
+
+	f_init();
+
+	/* Explicitly configure EWMA filtering with 80% smoothing (alpha = 0.2) */
+	f_vty_config(BTSVTY, "bts 0", "uplink-power-filtering algo ewma beta 80");
+	/* Explicitly configure the Uplink power range (target and delte) */
+	f_vty_config(BTSVTY, "bts 0", "uplink-power-target " & int2str(mp_uplink_power_target)
+					    & " hysteresis " & int2str(mp_uplink_power_hysteresis));
+
+	for (var integer i := 0; i < sizeof(g_AllChanTypes); i := i + 1) {
+		pars := valueof(t_Pars(g_AllChanTypes[i], ts_RSL_ChanMode_SIGN));
+		log(testcasename(), ": starting on ", pars.chan_nr);
+
+		vc_conn := f_start_handler(refers(f_TC_ms_pwr_ctrl_pf_ewma),
+					   pars, trxc_comp := true);
+		vc_conn.done;
+	}
+
+	/* No need to reset Uplink power parameters - the IUT restarts anyway */
+	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
 /* test generation of RLL ERR IND based on Um errors (TS 48.058 3.9) */
 /*	protocol error as per 44.006 */
 /*	link layer failure (repetition of I-frame N200 times without ACK */
@@ -7164,6 +7238,7 @@
 	execute( TC_chopped_ipa_payload() );
 
 	execute( TC_ms_pwr_ctrl_constant() );
+	execute( TC_ms_pwr_ctrl_pf_ewma() );
 }
 
 

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3be1a4a4a0ab7eebb9a930eee7039295c045a791
Gerrit-Change-Number: 20727
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201019/dbfcb8d8/attachment.htm>


More information about the gerrit-log mailing list