Comments (13)
I found a failure. The expression in comment L1074 // Et = 1/(S21mt - Ex)(1 - Es)
is incorrect, missing multiplier S11 for Es. The right is Et = 1/(S21mt - Ex)(1 - Es S11)
.
And assume S11 is 0 in treating thru as an ideal, it becomes Et = 1/(S11mt - Ex)
.
In short, the fixed code in NanoVNA-H is right.
from nanovna.
It's fixed! Thanks a lot @edy555
from nanovna.
yes, I can confirm, now error is smaller than 0.1 dB across entire bandwidth 0.05 - 900 MHz. For 0.05-300 even better - smaller than 0.01 dB :)
Thanks
from nanovna.
Same ripple present in 9508ea7. Attached photo. Scale is 0.5dB/div.
from nanovna.
More examples using both firmwares, allways using the original OSL kit but a quality RG316 50cm pigtail and quality adapters:
-
First test: calibrating for reflection at the end of the cable, using a F-F SMA adapter. Removing the adapter for THRU calibration.
-
Commit 9508ea7:
-
Second test: calibrating for reflection at the end of the cable, using a F-F SMA adapter. But this time i add a male-male adapter for THRU calibration.
-
Commit 9508ea7:
-
Third test: calibrating for reflection right at the CH0 SMA. Adding the pigtail for THRU calibration.
-
Commit 9508ea7:
It's clear to me that something weird is happening in newer firmwares. Some wrong interaction between reflection and transmission cal coeffs maybe? If i reset calibration and run a THRU cal without OSL steps, S21 response is perfectly flat.
from nanovna.
Cannot reproduce with the latest change set.
Hardware: NanoVNA-H
CH0 to CH1 cable: 10 cm RG405, soldered SMA
I have -0.2 dB error at 0.05 MHz after calibration, but it is almost flat and smoothly going to +0.1 dB error at 900 MHz.
from nanovna.
When I use RESET and then CALIBRATE THRU only I get almost zero S21 error from 0.05 MHz to 900 MHz. For some reason with a full calibration, there is error from -0.2 dB at 0.05 MHz to +0.1 dB at 900 MHz
from nanovna.
I tried to split calibration into two stages:
- OPEN, SHORT, LOAD, DONE
- ISOLN, THRU, DONE
And got S21 error almost zero from 0.05 MHz to 900 MHz.
But S11 works wrong after such calibration.
from nanovna.
I think you are experiencing the same error, but with a shorter cable the ripple period is much longer and not so evident.
You can't calibrate in two stages, once you press DONE, starting a new calibration resets previous one.
from nanovna.
More examples, this time including phase trace:
-
Commit 9508ea7 with full calibration. OSL al the end of the cable and then add a male-male adapter for THRU:
-
Commit 9508ea7 with full calibration but reflection calibration right at the CH0 connector. Then add cable for THRU:
-
Commit 9508ea7 with THRU calibration only:
Something is wrong.
from nanovna.
This may caused by difference between NanoVNA and NanoVNA-H.
NanoVNA-H does not use ETERM_ES (source match) for calculating ETERM_ET (transmission).
NanoVNA: https://github.com/ttrftech/NanoVNA/blob/master/main.c#L1058
// CAUTION: Et is inversed for efficiency
static void
eterm_calc_et(void)
{
int i;
for (i = 0; i < sweep_points; i++) {
// Et = 1/(S21mt - Ex)(1 - Es)
float esr = 1 - cal_data[ETERM_ES][i][0];
float esi = -cal_data[ETERM_ES][i][1];
float s21mr = cal_data[CAL_THRU][i][0] - cal_data[CAL_ISOLN][i][0];
float s21mi = cal_data[CAL_THRU][i][1] - cal_data[CAL_ISOLN][i][1];
float etr = esr * s21mr - esi * s21mi;
float eti = esr * s21mi + esi * s21mr;
float sq = etr*etr + eti*eti;
float invr = etr / sq;
float invi = -eti / sq;
cal_data[ETERM_ET][i][0] = invr;
cal_data[ETERM_ET][i][1] = invi;
}
cal_status &= ~CALSTAT_THRU;
cal_status |= CALSTAT_ET;
}
NanoVNA-H: https://github.com/hugen79/NanoVNA-H/blob/master/main.c#L1103
// CAUTION: Et is inversed for efficiency
static void
eterm_calc_et(void)
{
int i;
for (i = 0; i < sweep_points; i++) {
// Et = 1/(S21mt - Ex)(1 - Es)
// float esr = 1 - cal_data[ETERM_ES][i][0];
//float esi = -cal_data[ETERM_ES][i][1];
float s21mr = cal_data[CAL_THRU][i][0] - cal_data[CAL_ISOLN][i][0];
float s21mi = cal_data[CAL_THRU][i][1] - cal_data[CAL_ISOLN][i][1];
// float etr = esr * s21mr - esi * s21mi;
// float eti = esr * s21mi + esi * s21mr;
// float sq = etr*etr + eti*eti;
// float invr = etr / sq;
// float invi = -eti / sq;
float sq = s21mr*s21mr + s21mi*s21mi;
float invr = s21mr / sq;
float invi = -s21mi / sq;
cal_data[ETERM_ET][i][0] = invr;
cal_data[ETERM_ET][i][1] = invi;
}
cal_status &= ~CALSTAT_THRU;
cal_status |= CALSTAT_ET;
}
from nanovna.
cho45, I also notice these changes in calibration calc, but I'm not sure - which version is better?
from nanovna.
Just fixed at 0b885f2
Please try recent master branch or binary in https://app.circleci.com/jobs/github/ttrftech/NanoVNA/84/artifacts
from nanovna.
Related Issues (20)
- Calculation Questions!
- Firmware 0.5.4 'reald; HOT 1
- Re v0.8 bandwidth feature HOT 8
- Frequency Offset
- WRONG PID after update HOT 6
- Provide mecanism to stop rf output
- Update 20201013 - NanoVNA V2-2
- Screen capture HOT 1
- S21 gain figures
- How to re-activate marker settings after switching off the nanovna?
- Group Delay Calculation Does not Unwrap Phase
- NanoVNA not recognized by Python script HOT 8
- Upgrade failed. Restore. HOT 1
- How to calculate the values of resistive return loss bridge?
- MATLAB (on Windows) unable to read from NanoVNA V2_2
- Turkish language support
- sd card implementation
- How do I find the author and start communicating with him
- Plot Transmission Logmag Not Working
- Licens of code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanovna.