Commit 4b1f26fa authored by Marwan Hammouda's avatar Marwan Hammouda

[Develop]: command-line options for PI controller for timing offset copensation added

parent 395249b7
......@@ -132,6 +132,9 @@
#define CONFIG_HLP_FP_Scaling "set scaling P"
#define CONFIG_HLP_FI_Scaling "set scaling I"
#define CONFIG_HLP_TP_Scaling "set scaling P for TO"
#define CONFIG_HLP_TI_Scaling "set scaling I for TO"
/*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......@@ -198,6 +201,9 @@ extern uint16_t D_ScalingFD; //D scaling factor (denominator) of the PID control
extern double PScaling;
extern double IScaling;
extern double TO_PScaling;
extern double TO_IScaling;
extern int commonDoppler;
#endif
......@@ -444,6 +444,9 @@ uint16_t D_ScalingFD = 1; //D scaling factor (denominator) of the PID controller
double PScaling = 0.33;
double IScaling = 0.5;
double TO_PScaling = 1;
double TO_IScaling = 0.1;
int commonDoppler = 421528;
......
......@@ -80,6 +80,8 @@
{"DCDD" , CONFIG_HLP_FD_ScalingFD,0, .u16ptr=&D_ScalingFD, .defintval=1, TYPE_UINT16, 0}, \
{"DCP" , CONFIG_HLP_FP_Scaling,0, .dblptr=&PScaling, .defdblval=0.33, TYPE_DOUBLE, 0}, \
{"DCI" , CONFIG_HLP_FI_Scaling,0, .dblptr=&IScaling, .defdblval=0.5, TYPE_DOUBLE, 0}, \
{"TOP" , CONFIG_HLP_TP_Scaling,0, .dblptr=&TO_PScaling, .defdblval=1.0, TYPE_DOUBLE, 0}, \
{"TOI" , CONFIG_HLP_TI_Scaling,0, .dblptr=&TO_IScaling, .defdblval=0.1, TYPE_DOUBLE, 0} \
}
// clang-format on
......
......@@ -100,7 +100,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
TO_I_Ctrl += diff; //integral of all offsets
ue->rx_offset = diff;
ue->rx_offset_TO = diff+TO_I_Ctrl/I_ScalingF; //PI controller
//ue->rx_offset_TO = diff+TO_I_Ctrl/I_ScalingF; //PI controller
ue->rx_offset_TO = (TO_PScaling*diff) + (TO_I_Ctrl*TO_IScaling); //PI controller
ue->rx_offset_slot = 1;
ue->rx_offset_comp = 0;
......
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