Giter Club home page Giter Club logo

Comments (5)

qrp73 avatar qrp73 commented on August 9, 2024

There is some "simplification" in si5351 frequency setup code, it leads to wrong frequency set at some frequency boundaries. Like 300 MHz, 600 MHz, etc. And your issue looks like that, but the errors are propagated due to multi-sweep in the NanoVNA-Saver.

It's hard to fix, because such fix requires complicated logic. But you can avoid it. Just don't use sweep through these frequency boundaries, if you can't, then setup a small frequency step, it will minimize amount of points with a wrong frequency.

from nanovna-h.

DiSlord avatar DiSlord commented on August 9, 2024

Its problem come from set si5351 power(in auto mode, power = -1), try set power 0 or 2 and calibrate on all diapasone, and check again.
Also need correct gain table

from nanovna-h.

Pmax65 avatar Pmax65 commented on August 9, 2024

Hi to both (qrp73 and DiSlord),
First of all, thank you for you race about this.
Maybe I've been not clear in last message, let me try to tell you what is happening in other words.
The two plot plots are the results of tests of the same DUT using the same nanoVNA, but while the first is with the correction disabled (not resetted) the second is with the correction enabled.
In few words, I can switch between them just using [CAL]>[CORRECTION].
Please keep in mind that the calibration was done from 10kHz to 1.5GHz so the real calibration points are placed with 15MHz spaces between them all the other points are the results of the interpolation of the 2 consecutive calibration points.
The 5th order elliptic high pass filter is connected as per the following schematic detail:
FilterPlacedTemporary
As you can see, while when the frequency is above 300MHz the signal exits from CLK2 passing through the filter and sees the load of CH1 which is almost a resistive load with a little parasitic capacitance, when the frequency is below 300MHz the signal exits from CLK1 and sees the filter output via FC3. The discontinuities seen in the top plot is due to the poles and zeros in that range of frequency (excluding the 300MHz discontinuity of course, which is due to the band change).
I can easily remove that discontinuity by an RF SPDT switch, but I can't imagine why the calibration algorithm introduces that artifacts between the calibration points. Those almost parabolic correction shouldn't exist. Incredibly it seems that the correction works the other way it should work. In fact if I traced straight lines between those calibration points I have the real frequency response of the DUT S11 (except for the red calibration point which is completely wrong placed).
It seems to me that there could be a very bad bug in the calibration algorithm.

Have a great day.

Massimo IK1IZA

from nanovna-h.

DiSlord avatar DiSlord commented on August 9, 2024

Data on intepolation mode - use linear function see cal_interpolate(int s)
as write eddy ttrftech/NanoVNA#73

from nanovna-h.

DiSlord avatar DiSlord commented on August 9, 2024

Problem come from here:

        // avoid glitch between freqs in different harmonics mode
        if (IS_HARMONIC_MODE(src->_frequencies[j]) != IS_HARMONIC_MODE(src->_frequencies[j+1])) {
          // assume f[j] < f[j+1]
          k1 = IS_HARMONIC_MODE(f) ? 1.0 : 0.0;
        }

        float k0 = 1.0 - k1;
        for (eterm = 0; eterm < 5; eterm++) {
          cal_data[eterm][i][0] = src->_cal_data[eterm][j][0] * k0 + src->_cal_data[eterm][j+1][0] * k1;
          cal_data[eterm][i][1] = src->_cal_data[eterm][j][1] * k0 + src->_cal_data[eterm][j+1][1] * k1;
        }

Linear interpolation in most cases work good, but then change calibration from one harmonic to other:

        // avoid glitch between freqs in different harmonics mode
        if (IS_HARMONIC_MODE(src->_frequencies[j]) != IS_HARMONIC_MODE(src->_frequencies[j+1])) {
          // assume f[j] < f[j+1]
          k1 = IS_HARMONIC_MODE(f) ? 1.0 : 0.0;
        }

Its non correct. Used last value from left or first from right (not do interpolation), need made extrapolate use 2 point before or 2 after
Also it not work on 900MHz (used IS_HARMONIC_MODE(f)), it only for 300, for 900 used point after

from nanovna-h.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.