Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix About.py bug and fix math for TDR #715

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Conversation

EnPassant123
Copy link
Contributor

There is a bug with About.py which results in the program not being able to run if you call python nanovna_saver.py. The bug is caused by the path for setuptools-scm not being correctly defined. The path should be ../.. because the .git folder is two directories below, not ..

There is also a bug with the math for TDR. In the current state, the TDR is not able to distinguish between open and short. In the new code, the TDR is now able to calculate impedance.

Pull Request type

Please check the type of change your PR introduces:

  • [*] Bugfix
  • [] Feature
  • [] Code style update (formatting, renaming)
  • [] Refactoring (no functional changes, no API changes)
  • [] Build-related changes
  • [] Documentation content changes
  • [] Other (please describe):

What is the current behavior?

For the About.py bug: a LookupError is thrown by setuptools-scm.

For the TDR bug:
I am using a LiteVNA with a frequency span of 50kHz - 8 GHz. The same calibration was used for every test.

Here is the original software measuring an open transmission line:
image

Here is the original software measuring a short transmission line:
image

As you can see the graphs are literally the same, even though the impedance should be zero for the short and infinity for the open.

Here are the other two tests done below:
Terminated:
image

3dB attenuator:
image

Obviously the terminated plot should be flat and around 50 ohms, but that doesn't seem to be true. The 3dB attenuator should be around 131 ohms (according to my multimeter).

What is the new behavior?

Open Tline:
image

Shorted Tline:
image

Terminated Tline:
image

Tline terminated in 3dB attenuator (measures 131 ohms at DC)
image

Does this introduce a breaking change?

  • [] Yes
  • [*] No

Other information

The current code plots the magnitude of the impedance. Future updates might allow the user to plot the impedance in mag/ang or real/imag. It might also be a good idea to let the user set the scale for TDR measurements, instead of automatically setting it to 1000

Fix bug with setuptools_scm not being able to find .git
Fix math with TDR
@zarath
Copy link
Collaborator

zarath commented Oct 2, 2024

Thank you for submitting!

@zarath zarath merged commit 3e54d95 into NanoVNA-Saver:main Oct 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants