v0.3 correction table and correction applied to output level

pull/4/head
erikkaashoek 5 years ago
parent 8813fb4d3b
commit 33fb5ecca0

@ -861,8 +861,8 @@ config_t config = {
.vbat_offset = 500, .vbat_offset = 500,
.low_level_offset = 100, // Uncalibrated .low_level_offset = 100, // Uncalibrated
.high_level_offset = 100, // Uncalibrated .high_level_offset = 100, // Uncalibrated
.correction_frequency = { 100000, 200000, 400000, 1000000, 2000000, 50000000, 100000000, 200000000, 300000000, 350000000 }, .correction_frequency = { 10000, 100000, 200000, 500000, 50000000, 140000000, 200000000, 300000000, 330000000, 350000000 },
.correction_value = { +4.0, +2.0, +1.5, +0.5, 0.0, 0.0, +1.0, +1.0, +2.5, +5.0 }, .correction_value = { +6.0, +2.8, +1.6, -0.4, 0.0, -0.4, +0.4, +3.0, +4.0, +8.1 },
}; };
//properties_t current_props; //properties_t current_props;

@ -889,7 +889,7 @@ void calculate_correction(void)
pureRSSI_t get_frequency_correction(uint32_t f) // Frequency dependent RSSI correction to compensate for imperfect LPF pureRSSI_t get_frequency_correction(uint32_t f) // Frequency dependent RSSI correction to compensate for imperfect LPF
{ {
if (!(setting.mode == M_LOW)) if (!(setting.mode == M_LOW || setting.mode == M_GENLOW))
return(0.0); return(0.0);
int i = 0; int i = 0;
while (f > config.correction_frequency[i] && i < CORRECTION_POINTS) while (f > config.correction_frequency[i] && i < CORRECTION_POINTS)
@ -1423,13 +1423,14 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
} }
} }
if (setting.mode == M_GENLOW && setting.level_sweep != 0.0) { // if in low output mode and level sweep is active if (setting.mode == M_GENLOW && ( setting.frequency_step != 0 || setting.level_sweep != 0.0 || i == 0)) {// if in low output mode and level sweep or frequency weep is active or at start of sweep
float ls=setting.level_sweep; // calculate and set the output level float ls=setting.level_sweep; // calculate and set the output level
if (ls > 0) if (ls > 0)
ls += 0.5; ls += 0.5;
else else
ls -= 0.5; ls -= 0.5;
float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0; float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0;
a += PURE_TO_float(get_frequency_correction(f));
if (a != old_a) { if (a != old_a) {
old_a = a; old_a = a;
int d = 0; // Start at lowest drive level; int d = 0; // Start at lowest drive level;
@ -2391,7 +2392,7 @@ void draw_cal_status(void)
// Average // Average
if (setting.average>0) { if (setting.average>0) {
ili9341_set_foreground(BRIGHT_COLOR_BLUE); ili9341_set_foreground(BRIGHT_COLOR_GREEN);
y += YSTEP + YSTEP/2 ; y += YSTEP + YSTEP/2 ;
ili9341_drawstring("Calc:", x, y); ili9341_drawstring("Calc:", x, y);

Loading…
Cancel
Save

Powered by TurnKey Linux.