Commit f1ae1025 authored by Thomas Schlichter's avatar Thomas Schlichter

fix: ta-Common is a round-trip-time, not a one-way delay

parent acac0b21
......@@ -148,7 +148,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 478;
ta-Common-r17 = 29314900; # 119.37 ms
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......
......@@ -149,7 +149,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 40;
ta-Common-r17 = 2317000; # 9.435 ms
ta-Common-r17 = 4634000; # 18.87 ms
ta-CommonDrift-r17 = -230000; # -46 µs/s
positionX-r17 = 0;
positionY-r17 = -2166908; # -2816980.4 m
......
......@@ -247,7 +247,7 @@ These parameters can be provided to the gNB in the conf file in the section `ser
...
# GEO satellite
cellSpecificKoffset_r17 = 478;
ta-Common-r17 = 29314900; # 119.37 ms
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......@@ -256,7 +256,7 @@ These parameters can be provided to the gNB in the conf file in the section `ser
velocityVZ-r17 = 0;
# LEO satellite
# cellSpecificKoffset_r17 = 40;
# ta-Common-r17 = 2317000; # 9.435 ms
# ta-Common-r17 = 4634000; # 18.87 ms
# ta-CommonDrift-r17 = -230000; # -46 µs/s
# positionX-r17 = 0;
# positionY-r17 = -2166908; # -2816980.4 m
......
......@@ -556,9 +556,9 @@ typedef struct {
} fapi_nr_ta_command_pdu;
typedef struct {
// N_common_ta_adj represents common propagation delay received in SIB19 (ms)
// N_common_ta_adj represents common round-trip-time between gNB and SAT received in SIB19 (ms)
double N_common_ta_adj;
// N_UE_TA_adj calculated propagation delay from UE and SAT (ms)
// N_UE_TA_adj calculated round-trip-time between UE and SAT (ms)
double N_UE_TA_adj;
// drift rate of common ta in µs/s
double ntn_ta_commondrift;
......
......@@ -246,7 +246,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
}
// computes delay between ue and sat based on SIB19 ephemeris data
// computes round-trip-time between ue and sat based on SIB19 ephemeris data
static double calculate_ue_sat_ta(const position_t *position_params, NR_PositionVelocity_r17_t *sat_pos)
{
// get UE position coordinates
......@@ -259,9 +259,8 @@ static double calculate_ue_sat_ta(const position_t *position_params, NR_Position
double posy_0 = (double)sat_pos->positionY_r17 * 1.3;
double posz_0 = (double)sat_pos->positionZ_r17 * 1.3;
double distance = sqrt(pow(posx - posx_0, 2) + pow(posy - posy_0, 2) + pow(posz - posz_0, 2));
// this computation will ensure 3 decimal precision
double ta_ms = round(((distance / SPEED_OF_LIGHT) * 1000) * 1000.0) / 1000.0;
double distance = 2 * sqrt(pow(posx - posx_0, 2) + pow(posy - posy_0, 2) + pow(posz - posz_0, 2));
double ta_ms = (distance / SPEED_OF_LIGHT) * 1000;
return ta_ms;
}
......
......@@ -554,9 +554,9 @@ typedef struct {
} si_schedInfo_t;
typedef struct ntn_timing_advance_components {
// N_common_ta_adj represents common propagation delay received in SIB19 (ms)
// N_common_ta_adj represents common round-trip-time between gNB and SAT received in SIB19 (ms)
double N_common_ta_adj;
// N_UE_TA_adj calculated propagation delay from UE and SAT (ms)
// N_UE_TA_adj calculated round-trip-time between UE and SAT (ms)
double N_UE_TA_adj;
// drift rate of common ta in µs/s
double ntn_ta_commondrift;
......@@ -682,7 +682,7 @@ static inline int GET_NTN_UE_K_OFFSET(const ntn_timing_advance_componets_t *ntn_
static inline double GET_COMPLETE_TIME_ADVANCE_MS(const ntn_timing_advance_componets_t *ntn_ta)
{
return (ntn_ta->N_common_ta_adj + ntn_ta->N_UE_TA_adj) * 2;
return ntn_ta->N_common_ta_adj + ntn_ta->N_UE_TA_adj;
}
static inline long GET_DURATION_RX_TO_TX(const ntn_timing_advance_componets_t *ntn_ta)
......
......@@ -3620,7 +3620,7 @@ static void schedule_ntn_config_command(fapi_nr_dl_config_request_t *dl_config,
ntn_config_command_pdu->ntn_ta_commondrift = mac->ntn_ta.ntn_ta_commondrift;
ntn_config_command_pdu->N_common_ta_adj = mac->ntn_ta.N_common_ta_adj;
ntn_config_command_pdu->N_UE_TA_adj = mac->ntn_ta.N_UE_TA_adj;
ntn_config_command_pdu->ntn_total_time_advance_ms = (mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj) * 2;
ntn_config_command_pdu->ntn_total_time_advance_ms = mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj;
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_NTN_CONFIG_PARAMS;
dl_config->number_pdus += 1;
}
......
......@@ -148,7 +148,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 478; //GEO
ta-Common-r17 = 29319745;
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......
......@@ -148,7 +148,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 478; //GEO
ta-Common-r17 = 29319745;
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......
......@@ -147,7 +147,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 478; //GEO
ta-Common-r17 = 29319745;
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......
......@@ -147,7 +147,7 @@ gNBs =
#ext2
#ntn_Config_r17
cellSpecificKoffset_r17 = 478; //GEO
ta-Common-r17 = 29319745;
ta-Common-r17 = 58629666; # 238.74 ms
positionX-r17 = 0;
positionY-r17 = 0;
positionZ-r17 = 32433846;
......
......@@ -167,7 +167,7 @@ gNBs =
#ntn_Config_r17
# GEO satellite
# cellSpecificKoffset_r17 = 478;
# ta-Common-r17 = 29314900; # 119.37 ms
# ta-Common-r17 = 58629666; # 238.74 ms
# positionX-r17 = 0;
# positionY-r17 = 0;
# positionZ-r17 = 32433846;
......@@ -176,7 +176,7 @@ gNBs =
# velocityVZ-r17 = 0;
# LEO satellite
# cellSpecificKoffset_r17 = 40;
# ta-Common-r17 = 2317000; # 9.435 ms
# ta-Common-r17 = 4634000; # 18.87 ms
# ta-CommonDrift-r17 = -230000; # -46 µs/s
# positionX-r17 = 0;
# positionY-r17 = -2166908; # -2816980.4 m
......
......@@ -167,7 +167,7 @@ gNBs =
#ntn_Config_r17
# GEO satellite
# cellSpecificKoffset_r17 = 478;
# ta-Common-r17 = 29314900; # 119.37 ms
# ta-Common-r17 = 58629666; # 238.74 ms
# positionX-r17 = 0;
# positionY-r17 = 0;
# positionZ-r17 = 32433846;
......@@ -176,7 +176,7 @@ gNBs =
# velocityVZ-r17 = 0;
# LEO satellite
# cellSpecificKoffset_r17 = 40;
# ta-Common-r17 = 2317000; # 9.435 ms
# ta-Common-r17 = 4634000; # 18.87 ms
# ta-CommonDrift-r17 = -230000; # -46 µs/s
# positionX-r17 = 0;
# positionY-r17 = -2166908; # -2816980.4 m
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment