Skip to content

3D Pattern Measurement

This tutorial walks through measuring a complete 3D antenna radiation pattern using mcpositioner and mcnanovna together.

Prerequisites

  • NanoVNA-H connected via USB
  • ESP32 positioner built and on WiFi
  • Both MCP servers added to Claude Code:
    Terminal window
    claude mcp add mcnanovna -- uvx mcnanovna
    claude mcp add mcpositioner -- uvx mcpositioner

Setup

Physical Arrangement

Transmit Antenna
(on VNA Port 1)
│ Line of sight
┌─────────────────────────────────────────┐
│ │
│ Positioner │
│ ┌─────────────────┐ │
│ │ Antenna │ │
│ │ Under Test │◄── VNA Port 2
│ │ (rotates) │ │
│ └────────┬────────┘ │
│ │ │
│ θ axis │
│ │ │
│ ──────────────── │
│ φ axis │
└─────────────────────────────────────────┘
  • Transmit antenna: Fixed, connected to VNA Port 1
  • Antenna under test: Mounted on positioner, connected to VNA Port 2
  • Distance: Far-field (at least 2λ, preferably 10λ+)

Measurement Procedure

  1. Verify both servers are connected

    Ask Claude: “Check positioner status and VNA info”

    Claude will call positioner_status and info to verify both devices respond.

  2. Home the positioner

    Ask Claude: “Home the positioner on both axes”

    This establishes the reference position (theta=0, phi=0).

  3. Calibrate the VNA

    Ask Claude: “Calibrate for the 2m band”

    Follow the SOLT calibration procedure. This is critical for accurate S21 measurements.

  4. Run the pattern measurement

    Ask Claude: “Measure a 3D radiation pattern for my dipole antenna on 2m”

    Claude uses the measure_pattern_grid prompt to guide the measurement:

    • Confirms grid resolution (default: 5° theta × 10° phi)
    • Moves through each grid point in serpentine order
    • Measures S21 at each position
    • Assembles the pattern data
  5. View the results

    If the mcnanovna web UI is running (MCNANOVNA_WEB_PORT=8080), the pattern renders in 3D automatically.

    Or ask Claude: “Show the pattern statistics”

Resolution Tradeoffs

Step SizeGrid PointsTimeUse Case
10° × 20°342~9 minQuick survey, verify setup
5° × 10°1332~33 minStandard measurement
2° × 5°6552~2.7 hrPublication-quality

Pattern Normalization

By default, patterns are relative—the peak is set to 0 dBi. This shows the pattern shape but not absolute gain.

For absolute gain, measure a reference antenna first:

  1. Mount a known-gain antenna (e.g., calibrated dipole at 2.15 dBi)
  2. Measure S21 at bore-sight
  3. Note the reference S21 value
  4. Measure your antenna under test
  5. Offset all measurements: gain_dBi = S21_dB - reference_S21_dB + reference_gain_dBi

Troubleshooting

Pattern looks wrong

  • Check that the transmit antenna is properly aimed
  • Verify far-field distance (reflections cause errors)
  • Recalibrate VNA if temperature changed significantly

Measurement is noisy

  • Increase VNA averaging (use more points)
  • Reduce IF bandwidth
  • Check cable connections

Positioner loses position

  • Motors may be missing steps—reduce speed
  • Check mechanical coupling for slippage
  • Increase motor current in firmware

Web UI not updating

  • Check MCNANOVNA_WEB_PORT is set
  • Verify browser can reach the port
  • Check for WebSocket connection errors in browser console