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 mcnanovnaclaude 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
-
Verify both servers are connected
Ask Claude: “Check positioner status and VNA info”
Claude will call
positioner_statusandinfoto verify both devices respond. -
Home the positioner
Ask Claude: “Home the positioner on both axes”
This establishes the reference position (theta=0, phi=0).
-
Calibrate the VNA
Ask Claude: “Calibrate for the 2m band”
Follow the SOLT calibration procedure. This is critical for accurate S21 measurements.
-
Run the pattern measurement
Ask Claude: “Measure a 3D radiation pattern for my dipole antenna on 2m”
Claude uses the
measure_pattern_gridprompt 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
-
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 Size | Grid Points | Time | Use Case |
|---|---|---|---|
| 10° × 20° | 342 | ~9 min | Quick survey, verify setup |
| 5° × 10° | 1332 | ~33 min | Standard measurement |
| 2° × 5° | 6552 | ~2.7 hr | Publication-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:
- Mount a known-gain antenna (e.g., calibrated dipole at 2.15 dBi)
- Measure S21 at bore-sight
- Note the reference S21 value
- Measure your antenna under test
- 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_PORTis set - Verify browser can reach the port
- Check for WebSocket connection errors in browser console