diff --git a/executables/nr-ue.c b/executables/nr-ue.c index ff3b5c2110..c4237cb914 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -931,15 +931,17 @@ static inline void apply_ntn_config(PHY_VARS_NR_UE *UE, const double total_ta_ms = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_ms; const double total_ta_drift = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift; // µs/s - UE->timing_advance = fp->samples_per_subframe * (total_ta_ms + (total_ta_drift / 1000.0) * (ms_since_epoch / 1000.0)); + const double total_ta_drift_variant = UE->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift_variant; // µs/s² + UE->timing_advance = fp->samples_per_subframe * (total_ta_ms + (total_ta_drift / 1000.0) * (ms_since_epoch / 1000.0) + (total_ta_drift_variant / 1000.0) * (ms_since_epoch / 1000.0) * (ms_since_epoch / 1000.0)); LOG_I(PHY, - "k_offset = %d ms (%d slots), total_ta_ms = %f ms, total_ta_drift = %f µs/s, ms_since_epoch = %d ms, computed " + "k_offset = %d ms (%d slots), total_ta_ms = %f ms, total_ta_drift = %f µs/s, total_ta_drift_variant = %f µs/s², ms_since_epoch = %d ms, computed " "timing_advance = %d samples\n", *ntn_koffset, *ntn_koffset << mu, total_ta_ms, total_ta_drift, + total_ta_drift_variant, ms_since_epoch, UE->timing_advance); } diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 024c0b4220..64c8dab07e 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -563,8 +563,12 @@ typedef struct { // cell scheduling offset expressed in terms of 15kHz SCS long cell_specific_k_offset; + // ntn_total_time_advance_ms represents the complete round-trip-time between gNB and UE via SAT double ntn_total_time_advance_ms; + // drift rate of ntn_total_time_advance_ms in µs/s double ntn_total_time_advance_drift; + // change rate of ntn_total_time_advance_ms drift in µs/s² + double ntn_total_time_advance_drift_variant; } fapi_nr_dl_ntn_config_command_pdu; typedef struct { diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index fa8043966c..52d5033457 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -357,6 +357,7 @@ static void configure_ntn_params(PHY_VARS_NR_UE *ue, fapi_nr_dl_ntn_config_comma ue->ntn_config_message->ntn_config_params.cell_specific_k_offset = ntn_params_message->cell_specific_k_offset; ue->ntn_config_message->ntn_config_params.ntn_total_time_advance_ms = ntn_params_message->ntn_total_time_advance_ms; ue->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift = ntn_params_message->ntn_total_time_advance_drift; + ue->ntn_config_message->ntn_config_params.ntn_total_time_advance_drift_variant = ntn_params_message->ntn_total_time_advance_drift_variant; ue->ntn_config_message->update = true; } diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 921e3da6d1..ad7ae1a338 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -339,20 +339,27 @@ static void configure_ntn_ta(module_id_t module_id, ntn_ta->N_common_ta_drift = *ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17 * 0.2e-3; else // Need R - Release if not present ntn_ta->N_common_ta_drift = 0; + // ta_CommonDriftVariant_r17 (is in units of 0.2e-4 µs/s²) + if (ntn_Config_r17->ta_Info_r17->ta_CommonDriftVariant_r17) + ntn_ta->N_common_ta_drift_variant = *ntn_Config_r17->ta_Info_r17->ta_CommonDriftVariant_r17 * 0.2e-4; + else // Need R - Release if not present + ntn_ta->N_common_ta_drift_variant = 0; } else { // Need R - Release if not present ntn_ta->N_common_ta_adj = 0; ntn_ta->N_common_ta_drift = 0; + ntn_ta->N_common_ta_drift_variant = 0; } ntn_ta->ntn_params_changed = true; LOG_D(NR_MAC, - "SIB19 Rxd. Epoch SFN: %d, Epoch Subframe: %d, k_offset: %ldms, N_Common_Ta: %fms, drift: %fµs/s, N_UE_TA: %fms, drift: %fµs/s\n", + "SIB19 Rxd. Epoch SFN: %d, Epoch Subframe: %d, k_offset: %ldms, N_Common_Ta: %fms, drift: %fµs/s, variant %fµs/s², N_UE_TA: %fms, drift: %fµs/s\n", ntn_ta->epoch_sfn, ntn_ta->epoch_subframe, ntn_ta->cell_specific_k_offset, ntn_ta->N_common_ta_adj, ntn_ta->N_common_ta_drift, + ntn_ta->N_common_ta_drift_variant, ntn_ta->N_UE_TA_adj, ntn_ta->N_UE_TA_drift); } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index aeecf2ecaf..9e4fc64e63 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -533,6 +533,8 @@ typedef struct ntn_timing_advance_components { double N_common_ta_adj; // drift rate of common ta in µs/s double N_common_ta_drift; + // change rate of common ta drift in µs/s² + double N_common_ta_drift_variant; // N_UE_TA_adj calculated round-trip-time between UE and SAT (ms) double N_UE_TA_adj; // drift rate of N_UE_TA in µs/s diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 58ccbac7b4..6f6e6746cf 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2849,6 +2849,7 @@ static void schedule_ntn_config_command(fapi_nr_dl_config_request_t *dl_config, ntn_config_command_pdu->cell_specific_k_offset = mac->ntn_ta.cell_specific_k_offset; ntn_config_command_pdu->ntn_total_time_advance_ms = get_total_TA_ms(&mac->ntn_ta); ntn_config_command_pdu->ntn_total_time_advance_drift = get_total_TA_drift(&mac->ntn_ta); + ntn_config_command_pdu->ntn_total_time_advance_drift_variant = mac->ntn_ta.N_common_ta_drift_variant; dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_NTN_CONFIG_PARAMS; dl_config->number_pdus += 1;