28-02-2018  (3648 lectures) Categoria: Antenna

NanoVNA antenna analyzer - User guide

NanoVNA User Guide

  1. Introduction
    1. What is NanoVNA
    2. What you need for action
    3. Basics of NanoVNA
    4. NanoVNA oscillation frequency
  2. first thing to do
  3. input method
  4. How to read the screen
    1. Main screen
      1. 1. START 2. STOP Frequency
      2. 3. Markers
      3. 4. Calibration state
      4. 5. Reference position
      5. 6. Marker state
      6. 7. Trace state
      7. 8. Battery status
    2. main screen 2
      1. 9. CENTER Frequency 10. Span
      2. Menu screen
      3. 11. Menu
    3. keypad screen
      1. 12. Numeric keys
      2. 13. Back key
      3. 14. Unit key
      4. 15. Input field
  5. Start measurement
    1. Basic measurement sequence
  6. Calibration method
  7. function
    1. trace display
      1. trace format
      2. channel of trace
    2. marker
    3. time domain operations
      1. time domain bandpass
      2. time-domain lowpass impulse
      3. time-domain lowpass step
        1. Step response example
      4. time domain window
      5. Setting the Velocity Factor in the Time Domain
      6. Set frequency from marker
    4. Setting the measuring range
      1. Setting the start frequency and stop frequency
      2. Setting the center frequency and span
      3. zero span
      4. Temporarily stop measurement
    5. Recall calibration and settings
    6. Device settings
      1. Touch panel calibration and testing
      2. Saving instrument settings
      3. Show version
      4. Firmware update
  8. Firmware update method
    1. How to get the firmware
      1. ttrftech firmware
      2. hugen79 version firmware
      3. build it yourself
    2. How to write firmware
      1. Writing with dfu-util (Ubuntu)
      2. Writing with dfu-util (macOS)
      3. Writing with dfu-util (Windows 10)
    3. How to write firmware (Windows GUI)
      1. Convert file formats with DFU File Manager.
      2. Burn firmware with DfuSe Demo
  9. Firmware development guide
    1. Build with Docker
    2. On-chip debugging with Visual Studio Code
      1. tasks.json
      2. launch.json
      3. start debugging
  10. Example of use
    1. Adjusting the bandpass filter
    2. Antenna adjustment
      1. Trace settings
    3. Check cable
    4. Common mode filter measurement

Introduction

This document is an unofficial user guide for NanoVNA. The URL is https://cho45.github.io/NanoVNA-manual/.

It's maintained in a github repository .

If there are any discrepancies with the latest firmware, please send a pull-request if you have any corrections.

It's also available in PDF format on the Releases page on GitHub.

  • https://github.com/cho45/NanoVNA-manual/releases

What is NanoVNA

There are several types of NanoVNA hardware, and this document covers the following hardware:

These hardware have almost identical circuit components and common firmware is available.

What you need for action

You will need at least the following:

  • NanoVNA body
  • SMA LOAD 50Ω
  • SMA SHORT
  • SMA OPEN
  • SMA Female to Female Thru Connector
  • 2 x SMA Male to Male Cables

Basics of NanoVNA

A VNA (Vector Network Analyzer) measures the frequency characteristics of the reflected power and transmitted power of a high frequency network (RF Network).

NanoVNA measures:

  • Input voltage I/Q signal
  • Reflected voltage I/Q signal
  • Pass voltage I/Q signal

From here we calculate:

  • reflection coefficients S11
  • transmission coefficient S21

The following items that can be calculated from these can be displayed.

  • return loss
  • pass loss
  • complex impedance
    • resistance
    • reactance
  • SWR

Such.

NanoVNA oscillation frequency

NanoVNA measures reflection and transmission coefficients at 101 points in the target frequency band.

NanoVNA's local oscillator frequency ranges from 50kHz to 300MHz. Higher frequencies use harmonic mode. The fundamental wave is not attenuated even in harmonic mode. The usage modes for each frequency are as follows.

  • Up to 300MHz: Fundamental
  • 300MHz to 900MHz: 3rd harmonic
  • 900MHz to 1500MHz: 5th harmonic

Especially when checking the gain of the amplifier, etc., it is necessary to pay attention to the fact that there is always the input of the fundamental wave.

The input is converted to an intermediate frequency of 5kHz in both cases. The signal is analog-to-digital converted at 48kHz sampling. Digital data is processed by the MCU.

first thing to do

It must be calibrated before use. First, calibrate as follows.

input method

NanoVNA has the following inputs:

  • Touch panel tap/long tap
  • lever switch
    • Long press L/L
    • Long press R/R
    • Press / Press and Hold
  • power slide switch

How to read the screen

Main screen

1. START 2. STOP Frequency

Each frequency when start/stop is specified is displayed.

3. Markers

The position of the marker for each trace is displayed. Selected markers can be moved in the following ways:

  • Drag the marker on the touch panel
  • Long press LR on the lever switch

4. Calibration state

Displays the data number of the calibration being read and the error correction applied.

  • C0 C1 C2 C3 C4: Each indicates that the calibration data with the corresponding number is loaded.
  • c0 c1 c2 c3 c4: Each indicates that the corresponding number of calibration data has been loaded, but that the frequency range has been changed after loading and that interpolation is used for error correction.
  • D: indicates that directivity error correction is applied
  • R: Indicates that reflection tracking error correction is applied
  • S: indicates that source match error correction is applied
  • T: indicates that transmission tracking error correction is applied
  • X: indicates that isolation (crosstalk) error correction is applied

5. Reference position

Indicates the reference position of the corresponding trace. DISPLAY SCALE REFERENCE POSITIONYou can change the position with .

6. Marker state

Shows the currently selected active marker and one previously active marker.

7. Trace state

Displays the state of each trace format and the value corresponding to the active marker.

For example CH0 LOGMAG 10dB/ 0.02dB, read as follows.

  • Channel CH0 (reflection)
  • formatLOGMAG
  • Scale is 10dB
  • Current value is 0.02dB

Also, the channel display for the active trace is inverted.

8. Battery status

When the battery is installed and on the PCB D2is populated, an icon will be displayed according to the battery voltage.


main screen 2

9. CENTER Frequency 10. Span

Displays each frequency when the center frequency and span are specified.


Menu screen

11. Menu

You can display the menu by the following operation.

  • When tapping a place other than the marker on the touch panel
  • push lever switch

keypad screen

12. Numeric keys

Tap a number to enter one character.

13. Back key

Delete one character. If you have not entered even one character, cancel the input and return to the previous state.

14. Unit key

Multiply the current input by the appropriate unit and exit the input immediately. In the case of ×1, the entered numerical value is set as is.

15. Input field

The item name to be entered and the entered number are displayed.

Start measurement

Basic measurement sequence

  1. Setting the frequency range to measure
  2. calibrate
  3. Connect DUT

Calibration method

Calibration should basically be performed every time the frequency range to be measured is changed. If the error has been corrected correctly, the calibration status display on the screen Cn D R S T Xwill be . n is the data number being loaded.

However, NanoVNA can supplement existing calibration information to give a somewhat correct display. This happens if you change the frequency range after loading the calibration data. At this time, the display of the calibration status on the screen cn D R S T Xbecomes . n is the data number being loaded.

  1. Reset the current calibration stateCAL RESET
  2. Connect the OPEN standard to the CH0 port and CAL CALIBRATE OPENexecute.
  3. Connect the SHORT standard to the CH0 port and CAL CALIBRATE SHORTrun.
  4. Connect the LOAD standard to the CH0 port and CAL CALIBRATE LOADrun.
  5. Connect the LOAD standard to the CH0 and CH1 ports and CAL CALIBRATE ISOLNexecute. CH0 port can be left unconnected if there is only one load.
  6. Connect the cables to the CH0 and CH1 ports, connect the cables to each other with through connectors, and CAL CALIBRATE THRUexecute .
  7. Finish calibration and calculate error correction informationCAL CALIBRATE DONE
  8. Specify the data number and save.CAL CALIBRATE SAVE SAVE 0

* Each calibration data must be loaded after the display has stabilized sufficiently.

function

trace display

Up to four traces can be displayed, one of which is the active trace.

Traces can be displayed only as needed. DISPLAY TRACE TRACE nSelect to toggle the display .

There are the following methods to switch the active trace.

  • Tap the marker of the trace you want to activate
  • DISPLAY TRACE TRACE nto display. (If already visible, it should be temporarily hidden)

trace format

Each trace can specify its own format. To change the format of the active trace, DISPLAY FORMATselect the format you want to change.

The display of each format is as follows.

  • LOGMAG: logarithm of the absolute value of the measured value
  • PHASE: Phase in the range -180° to +180°
  • DELAY: delay
  • SMITH: Smith Chart
  • SWR: Standing Wave Ratio
  • POLAR: polar coordinate format
  • LINEAR: absolute value of measured value
  • REAL: real number of measurements
  • IMAG: the imaginary number of the measured value
  • RESISTANCE: Resistance component of measured impedance
  • REACTANCE: Reactance component of measured impedance

channel of trace

NanoVNA CH0 CH1has two ports. The following S-parameters can be measured at each port.

  • CH0S11 (reflection loss)
  • CH1S21 (insertion loss)

Select DISPLAY CHANNELor to change the channel of the trace CH0 REFLECT.CH1 THROUGH

marker

Up to four markers can be displayed. The display of the marker MARKER SELECT MARKER MARKER nis done from. Displaying a marker sets the active marker to the displayed marker.

time domain operations

NanoVNA can simulate time domain measurements by signal processing frequency domain data.

DISPLAY TRANSOFRM TRANSFORM ONSelect to convert the measurement data to the time domain . TRANSFORM ONIf is enabled, the measurement data is immediately converted to the time domain and displayed.

The time domain and frequency domain have the following relationship:

  • The higher the maximum frequency, the higher the time resolution.
  • The narrower the measurement frequency interval (i.e. the lower the maximum frequency), the longer the maximum time length.

Therefore, there is a trade-off relationship between maximum time length and time resolution.

If we compare the length of time with the distance, we can say the following.

  • If you want to increase the maximum measurement distance, you need to lower the maximum frequency
  • If you want to specify the distance with good accuracy, you need to increase the maximum frequency.

time domain bandpass

Bandpass mode allows you to simulate a DUT's response to an impulse signal.

The trace format LINEAR LOGMAG SWRcan be set to

Below is an example of the impulse response of a bandpass filter.

time-domain lowpass impulse

Lowpass mode allows you to simulate a TDR. In low pass mode, the start frequency should be set to 50kHz and the stop frequency should be set according to the distance you want to measure.

REALYou can set the trace format to

An example of step response in open state and impulse response in short state is shown below.

time-domain lowpass step

Lowpass mode allows you to simulate a TDR. In low pass mode, the start frequency should be set to 50kHz and the stop frequency should be set according to the distance you want to measure.

REALYou can set the trace format to

open:

short:

Step response example

Capacitive short:

Inductive short:

Capacitive discontinuity (C in parallel):

Inductive discontinuity (L in series):

time domain window

The measurable range is a finite number, and there are minimum and maximum frequencies. A window can be used to smooth this discontinuous measurement data and reduce ringing.

The window has three stages.

  • MINIMUM (no window, i.e. same as rectangular window)
  • NORMAL (corresponds to β=6 in Kaiser window)
  • MAXIMUM (corresponds to Kaiser window β=13)

MINIMUM gives maximum resolution, MAXIMUM gives maximum dynamic range. NORMAL is in between.

Setting the Velocity Factor in the Time Domain

The transmission speed of electromagnetic waves in a cable varies depending on its material. The ratio to the transmission speed of electromagnetic waves in vacuum is called the wavelength shortening rate (Velocity Factor, Velocity of propagation). This is always stated in the cable specification.

In the time domain, the displayed time can be converted to distance. The wavelength shortening rate used for distance display DISPLAY TRANSFORM VELOCITY FACTORcan be set with . For example, if you measure the TDR of a cable with a wavelength shortening rate of 67%, VELOCITY FACTORspecify 67.

Set frequency from marker

You can set the frequency range from the markers as follows.

  • MARKER →STARTSets the frequency of the active marker to the start frequency
  • MARKER →STOPSets the frequency of the active marker to the stop frequency
  • MARKER →CENTERSets the frequency of the active marker to the center frequency. The span will be adjusted to maintain the current range as much as possible.
  • MARKER →SPANSets the two visible markers to the span, including the active marker. Nothing happens if only one marker is visible.

Setting the measuring range

There are three types of measurement range settings.

  • Setting the start frequency and stop frequency
  • Setting the center frequency and span
  • zero span

Setting the start frequency and stop frequency

Select and set STIMULUS START, respectively .STIMULUS STOP

Setting the center frequency and span

Select and set STIMULUS CENTER, respectively .STIMULUS SPAN

zero span

Zero span is a mode in which one frequency is sent continuously without sweeping the frequency.

STIMULUS CW FREQto set.

Temporarily stop measurement

STIMULUS PAUSE SWEEPSelect to temporarily stop measurement.

Recall calibration and settings

Up to 5 calibration data can be saved. NanoVNA will load data with number 0 immediately after startup.

Calibration data is data that contains the following information:

  • Frequency setting range
  • Error correction at each measurement point
  • Trace setting state
  • Marker setting state
  • Domain mode setting
  • Setting the wavelength shortening rate
  • electrical delay

CAL SAVE SAVE nYou can save the current settings by selecting .

CAL RESETYou can reset the current calibration data by selecting . If you want to calibrate again, RESETyou have to do it.

CAL CORRECTIONindicates whether error correction is currently in progress. You can select this to temporarily stop error correction.

RECALL RECALL nYou can recall the saved settings by selecting .

Device settings

CONFIGBelow you can make general settings for the device.

Touch panel calibration and testing

CONFIG TOUCH CALSelect to calibrate the touch panel. If there is a large difference between the actual tap position and the perceived tap position, doing this can help. TOUCH CALAfter doing , TOUCH TESTcheck that the settings are correct by doing , and SAVEsave the settings with .

CONFIG TOUCH TESTSelect to test the touch panel. A line is drawn while you tap the touch panel. When released from the touch panel, it returns to its original state.

Saving instrument settings

CONFIG SAVESelect to save general instrument settings. General device settings are data containing the following information:

  • Touch panel calibration information
  • grid color
  • trace color
  • Calibration data number loaded by default

There is currently no way to configure, other than touch panel calibration information.

Show version

CONFIG VERSIONSelect to display the device version information.

Firmware update

CONFIG →DFU RESET AND ENTER DFUSelect to reset the device and enter DFU (Device Firmware Update) mode. Firmware update is possible via USB in this mode.

Firmware update method

How to get the firmware

ttrftech firmware

Original firmware. It is versioned and frequently developed.

GitHub releases have reasonably stable release versions of the firmware.

CircleCI has all the firmware per commit. Use this if you want to try the latest functions or check for bugs.

hugen79 version firmware

The latest firmware is located on Google Drive.

build it yourself

You can easily clone the github repository and build it yourself.

How to write firmware

There are various ways to write, but here we will explain using dfu-util . dfu-util is a cross-platform tool, and binaries are also provided on Windows, so you can just download it and use it.

Writing with dfu-util (Ubuntu)

There is dfu-util in the standard package repository.

sudo apt-get install dfu-util
dfu-util --version

Boot the device into DFU mode. Enter DFU mode in one of the following ways:

  • Power on while jumpering the BOOT0 pin on the PCB. (Remove the jumper after turning on the power) The screen is completely white, but this is normal.
  • CONFIG →DFU RESET AND ENTER DFUto choose

Run the following command. build/ch.bin describes the path to the downloaded firmware file .bin.

dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin

Writing with dfu-util (macOS)

It is recommended to install using homebrew .

Install the brew command.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the dfu-util command.

brew install dfu-util

Confirm that the dfu-util command can be successfully launched.

dfu-util --version

Boot the device into DFU mode. Enter DFU mode in one of the following ways:

  • Power on while jumpering the BOOT0 pin on the PCB. (Remove the jumper after turning on the power) The screen is completely white, but this is normal.
  • CONFIG →DFU RESET AND ENTER DFUto choose

Run the following command. build/ch.bin describes the path to the downloaded firmware file .bin.

dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin

Writing with dfu-util (Windows 10)

On Windows, connecting a NanoVNA in DFU mode automatically installs the device driver, but dfu-util is not available for this device driver. Here you can use Zadig to replace the driver.

Boot the device into DFU mode. Enter DFU mode in one of the following ways:

  • Power on while jumpering the BOOT0 pin on the PCB. (Remove the jumper after turning on the power) The screen is completely white, but this is normal.
  • CONFIG →DFU RESET AND ENTER DFUto choose

Start Zadig with NanoVNA in DFU mode connected, and use WinUSB as a driver for STM32 BOOTLOADER as follows.

* If you want to restore the driver, search for the corresponding device from "Universal Serial Bus Controllers" in "Device Manager" and execute "Uninstall Device". Unplug the USB connector and plug it in again, and the driver will be installed automatically.

Then place dfu-util. Download dfu-util-0.9-win64.zip from releases and extract it. Here, as an example, it is assumed that it is expanded to C:dfu-util (anywhere is fine).

Right-click the Start Menu and select Windows PowerShell. A shell window will open.

If you drag and drop dfu-util.exe from Explorer to PowerShell, the path will be automatically inserted. --versionYou can display the version of dfu-util by starting it with the following .

C:dfu-utildfu-util.exe --version

Similarly, you can enter the path of the firmware file by dragging and dropping it from Explorer to PowerShell.

Run the following command. build/ch.bin describes the path to the downloaded firmware file .bin.

C:dfu-utildfu-util.exe -d 0483:df11 -a 0 -s 0x08000000:leave -D buildch.bin

How to write firmware (Windows GUI)

For those who are unfamiliar with CUI, we will also introduce the writing method using the DfuSE Demo tool provided by ST, although it requires a slightly complicated procedure.

Download STSW-STM32080 from ST site .

  • DFU File Manager: tool to create .dfu files from .bin or .hex
  • DfuSe Demo: Tool to write .dfu files to devices

contained.

Convert file formats with DFU File Manager.

First launch DFU File Manager.

I want to GENERATE a DFU file from S19, HEX or BIN filesChoose.

S19 or Hex...Click the button. ch.hexSelect the firmware .hex file, etc.

Generate...Click the button to create a .dfu file with a suitable name.

Burn firmware with DfuSe Demo

First boot the device in DFU mode. Enter DFU mode in one of the following ways:

  • Power on while jumpering the BOOT0 pin on the PCB. (Remove the jumper after turning on the power) The screen is completely white, but this is normal.
  • CONFIG →DFU RESET AND ENTER DFUto choose

Start the DfuSe Demo. STM Device in DFU ModeMake sure it's in Available DFU Devices and Choose...click it.

Select the .dfu file you saved earlier.

UpgradeClick the button.

When the writing is finished, this screen will appear, so Leave DFU modeclick the button to exit DFU mode. The device will reset and boot with the new firmware.

Firmware development guide

Here are the things you need to develop firmware for NanoVNA:

  • Git
  • gcc-arm-none-eabi
  • make

If you already have these, makeyou can build the firmware with.

git clone git@github.com:ttrftech/NanoVNA.git
cd NanoVNA
git submodule update --init --recursive
make

Build with Docker

With docker you can build without hassle. docker is a freely available cross-platform container utility. It can be used to quickly reproduce a particular environment (in this case the build environment).

After installing docker , just run the following command.

docker run -it --rm -v $(PWD):/work edy555/arm-embedded:8.2 make

On-chip debugging with Visual Studio Code

Visual Studio Code (VSCode) is a multi-platform code editor provided free of charge by Microsoft. By installing Cortex-Debug Extension, you can do on-chip debugging with GUI.

I'll leave out the platform-dependent parts, but in addition to the above, you'll need:

  • openocd
  • VS Code
  • Cortex-Debug

Cortex-Debug is searched from Extensions of VSCode and Installed.

tasks.json

First, define a "task" that makes the entire NanoVNA on VSCode.

{
    "tasks": [
        {
            "type": "shell",
            "label": "build",
            "command": "make",
            "args": [
            ],
            "options": {
                "cwd": "${workspaceRoot}"
            }
        }
    ],
    "version": "2.0.0"
}

Now you can make it as a task on VSCode.

launch.json

Next, define how to start when Debug. Set as described in Cortex-Debug.

Below are the settings when using ST-Link. If you use J-Link, replace with interface/stlink.cfg.interface/jlink.cfg

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "cortex-debug",
            "servertype": "openocd",
            "request": "launch",
            "name": "OpenOCD-Debug",
            "executable": "build/ch.elf",
            "configFiles": [
                "interface/stlink.cfg",
                "target/stm32f0x.cfg"
            ],
            "svdFile": "./STM32F0x8.svd",
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "build",
        }
    ]
}

svdFileThe file specified in can be downloaded from the ST site . svdFileThere is no problem in operation even if is not specified.

start debugging

Start Debugging ( F5) will automatically launch OpenOCD and transfer the firmware after building with make. When the transfer ends, the reset handler breaks.

svdFile, the defined MCU registers will be displayed on the debug screen.

Example of use

Adjusting the bandpass filter

TO DO

Antenna adjustment

Here is an example of using NanoVNA as an antenna analyzer.

The following two points are important in adjusting the antenna.

  • Is the antenna in tune/resonance (i.e. is the reactance close to 0 at the desired frequency)?
  • Antenna SWR is low (well matched)

Trace settings

Since only CH0 is used for antenna adjustment, perform calibration for all items other than THRUand .ISOLN

Set the trace settings as follows.

  • Trace 0: CH0 SWR
  • Trace 1: CH0 REACTANCE
  • Trace 2: CH0 SMITH
  • Trace 3: OFF

CENTERSet the frequency you want to tune the antenna to and SPANset appropriately.

Find the frequency where trace 1 displaying the reactance is close to 0. Since that frequency is the tuning point, if it is off, adjust the antenna so that the tuning point comes to the target frequency.

Once the tuning point is at the frequency of interest, check to see if trace 0, which displays the SWR, displays a sufficiently low (close to 1) SWR. If it doesn't show enough SWR (below 2), we use the Smith Chart to do the matching. At this time, matching may be performed using an antenna tuner directly below the antenna.

If the SWR drops, the antenna is tuned at the desired frequency and the tuning for the antenna with the low SWR is over.

Check cable

A TDR can be simulated using the time domain lowpass mode. By using TDR, it is possible to discover faults in the transmission path.

TO DO

Common mode filter measurement

TO DO




versió per imprimir