diff --git a/include/Positions.h b/include/Positions.h index f8995f7..81a8ea3 100644 --- a/include/Positions.h +++ b/include/Positions.h @@ -40,8 +40,8 @@ const FrequencyRange RANGE_70_125MHZ = 125000000U, 100000000U, FG_120MHZ, - 34250U, // FIND VALUES - 45000U, // FIND VALUES + 34400U, + 48500U, }; const FrequencyRange RANGE_125_180MHZ = diff --git a/src/ATM.ino b/src/ATM.ino index 5860be0..60929e6 100644 --- a/src/ATM.ino +++ b/src/ATM.ino @@ -349,7 +349,7 @@ void changeFrequencyRange(FrequencyRange target_range) tuner.STEPPER.moveTo(target_range.TUNING_CENTER_POSITION); tuner.STEPPER.runToPosition(); - matcher.STEPPER.moveTo(target_range.TUNING_CENTER_POSITION); + matcher.STEPPER.moveTo(target_range.MATCHING_CENTER_POSITION); matcher.STEPPER.runToPosition(); } @@ -631,10 +631,14 @@ int optimizeMatching(uint32_t current_resonance_frequency) matcher.STEPPER.move(iteration_steps); matcher.STEPPER.runToPosition(); - delay(250); + delay(50); current_resonance_frequency = findCurrentResonanceFrequency(current_resonance_frequency - 1000000U, current_resonance_frequency + 1000000U, FREQUENCY_STEP / 2); + // Skip this iteration if the resonance has been lost + if (current_resonance_frequency == 0) + continue; + adf4351.setf(current_resonance_frequency); delay(10);