Skip to main content
ClaudeWave
Skill618 estrellas del repoactualizado 8d ago

matlab-design-pcb-antenna

This MATLAB skill designs PCB antennas using the Antenna Toolbox pcbStack function to create multi-layer stackups with custom metal patterns, boolean shape operations, and various feed types (probe, edge, aperture). Use it when designing or fabricating printed antennas from scratch, converting catalog antennas to PCB format, adding custom elements like slots or vias, or generating Gerber files for manufacturing.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-design-pcb-antenna && cp -r /tmp/matlab-design-pcb-antenna/skills-catalog/rf-and-mixed-signal/matlab-design-pcb-antenna ~/.claude/skills/matlab-design-pcb-antenna
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# PCB Antenna Design Skill

You are an expert RF and antenna engineer assisting a professional engineer with PCB antenna design. Use MATLAB Antenna Toolbox `pcbStack` to build multi-layer printed circuit board antennas with custom metal patterns, configure feeds and vias, analyze performance, and generate Gerber files for fabrication.

## When to Use

- User wants to design a PCB antenna or printed antenna from scratch
- User wants to build a multi-layer antenna stackup
- User wants to convert a catalog antenna (patchMicrostrip, pifa) to pcbStack
- User wants to add custom metal patterns, slots, or parasitic elements to a PCB
- User asks about probe feed, edge feed, or aperture-coupled feed on a PCB
- User wants to export Gerber files for antenna fabrication
- User wants to add via stitching or shorting vias

## When NOT to Use

- User wants a simple catalog antenna analysis — use `matlab-design-antenna`
- User wants a matching network — use `matlab-design-matching-network`
- User wants a reflectarray with unit cells — use `matlab-design-reflectarray`
- User wants to design a curved reflector — use `matlab-design-reflector-antenna`

## Core Workflow

1. **Parse the request** -- Identify the antenna type, operating frequency, substrate, number of layers, feed method, and any constraints (board size, connector type).

2. **Design the stackup** -- Create a `pcbStack` with the correct layer ordering: metal shapes and dielectric objects, top-to-bottom.

3. **Configure feeds and vias** -- Set `FeedLocations` with correct layer indices, add vias for grounding or stitching.

4. **Analyze** -- Compute impedance, S-parameters, radiation pattern, and bandwidth.

5. **Export** -- Generate Gerber fabrication files with connector footprints.

## Layer Stack Construction

This is the most error-prone step. The `Layers` property is a cell array specified **top-to-bottom**, alternating between metal shapes and dielectric objects.

```matlab
% 3-layer: patch on FR4 with ground plane
subHeight = 1.6e-3;
sub = dielectric("FR4");

p = pcbStack;
p.BoardShape = antenna.Rectangle(Length=60e-3, Width=60e-3);
p.BoardThickness = subHeight;       % MUST be set BEFORE Layers
p.Layers = {patch, sub, ground};    % {metal(1), diel(2), metal(3)}
```

### Critical Rules

1. **Set `BoardThickness` BEFORE `Layers`** -- Setting `Layers` always overwrites the dielectric thickness with the current `BoardThickness`. If you set Layers first, the dielectric gets the default 10 mm thickness, and setting BoardThickness afterwards does NOT fix it. To suppress the warning, also set `sub.Thickness` to the same value as `BoardThickness` before assigning Layers.

2. **Layer indices reference cell array positions** -- In `FeedLocations` and `ViaLocations`, layer numbers are cell array indices (1, 2, 3, ...), not metal-only indices. In `{metal, diel, metal}`, the metals are at indices 1 and 3.

3. **First and last entries are typically metal** -- but dielectric layers can also appear as the first or last entry when needed (e.g., radome above the top patch, or substrate beneath the bottom feed layer). Example: `{diel, patch, diel, slottedGround, diel, feedLine}`.

4. **`BoardThickness` = total dielectric below top metal** -- For multi-substrate stacks, this equals the sum of all dielectric thicknesses.

### 3-Layer Stack (Most Common)

```matlab
% {topMetal(1), dielectric(2), bottomMetal(3)}
p.Layers = {patch, sub, ground};
p.FeedLocations = [x, y, 1, 3];    % sig=1(top), gnd=3(bottom)
```

### 2-Layer Stack (Air Dielectric)

When only two metal layers are specified with no dielectric object, the stack assumes air as the dielectric between them:

```matlab
% {topMetal(1), bottomMetal(2)} -- air dielectric assumed
p.Layers = {radiator, ground};
p.FeedLocations = [x, y, 1, 2];    % sig=1(top), gnd=2(bottom)
```

### 5-Layer Stack (Aperture-Coupled)

```matlab
% {radiator(1), upperSub(2), slottedGround(3), lowerSub(4), feedLine(5)}
p.BoardThickness = upperSubHeight + lowerSubHeight;
p.Layers = {radiator, upperSub, slottedGround, lowerSub, feedLine};
p.FeedLocations = [x, y, 5, 3];    % sig=5(feedLine), gnd=3(ground)
```

### Substrate Materials

| Material | EpsilonR | LossTangent | Use Case |
|----------|----------|-------------|----------|
| `"FR4"` | 4.8 | 0.026 | Prototyping, low cost |
| Custom `"RO4003C"` | 3.55 | 0.0027 | High-frequency, low loss |
| `"Teflon"` | 2.1 | 0.0002 | Very low loss |
| `"Air"` | 1.0 | 0 | 2-layer stacks with physical spacer |

For materials not in the built-in catalog, create a custom dielectric:

```matlab
sub = dielectric(Name="RO4003C", EpsilonR=3.55, LossTangent=0.0027, Thickness=h);
```

## Shape Operations for Metal Patterns

All shapes are in the `antenna` namespace. Build complex metal patterns using boolean operations.

### Available Shapes

| Shape | Key Properties |
|-------|---------------|
| `antenna.Rectangle` | `Length`, `Width`, `Center`, `NumPoints` |
| `antenna.Circle` | `Radius`, `Center`, `NumPoints` |
| `antenna.Ellipse` | `MajorAxis`, `MinorAxis`, `Center` |
| `antenna.Polygon` | `Vertices` (N-by-3 matrix) |
| `antenna.Triangle` | `InputType` ("SSS"/"SAS"/"ASA"), `Side`, `Angle` |

### Boolean Operations

```matlab
% Union: combine shapes
patchWithFeed = patch + feedLine;

% Subtraction: cut slots, notches, holes
gndWithSlot = ground - slot;
eNotch = patch - notch1 - notch2;

% Intersection: overlap region
overlap = shape1 & shape2;
```

### Geometric Transforms

```matlab
% Translate
shifted = translate(shape, [dx, dy, 0]);

% Rotate (requires axis definition, or use rotateZ convenience)
rotated = rotate(shape, angleDeg, [0 0 0], [0 0 1]);
rotated = rotateZ(shape, angleDeg);

% Mirror (for symmetric geometries — fractals, bowties, balanced structures)
mirrored = mirrorX(copy(shape));    % mirror across Y-axis
mirrored = mirrorY(copy(shape));    % mirror across X-axis

% Copy (duplicate before transforming to preserve original)
shapeCopy = copy(shape);

% Scale
bigger = scale(shape, fa
matlab-train-networkSkill

>

matlab-driving-data-importerSkill

Import recorded driving sensor data (GPS, camera, lidar, actor tracks, lanes) into scenariobuilder.* objects (GPSData, CameraData, LidarData, ActorTrackData, Trajectory, laneData) and run preprocessing — synchronize, offset correction, crop, normalizeTimestamps, convertTimestamps. Also: compute actor tracks from lidar when no annotations exist, attach camera/lidar mounting + intrinsics, export to MAT/workspace/timetable/script. Use for raw driving dataset files (KITTI, nuScenes, Waymo, Pandaset, ROS/ROS2 bags, .mat, .csv, .mp4) or driving/vehicle/sensor logs that need wrapping. drivingLogAnalyzer (DLA) is OPT-IN ONLY — invoke only on explicit user request ('DLA', 'open in DLA', 'inspect/explore/analyze the recording') or reported sensor problem (sync drift, timestamp mismatch, overlay misalignment). NEVER auto-launch DLA after wrapping (Rule 0). For 'build scenario / export to RoadRunner / drivingScenario / OpenSCENARIO / Unreal / simulate', hand off to matlab-scenario-builder.

matlab-scenario-builderSkill

Generate driving scenes, scenarios, road surfaces, and 3D content from already-wrapped scenariobuilder.* sensor data (GPS, camera, lidar, actor tracks) using Scenario Builder for Automated Driving Toolbox. Use to BUILD, EXPORT, or AUGMENT a virtual scenario/scene/map: ego or actor trajectories, trajectory smoothing, OpenCRG road-surface extraction, 3D asset generation, static-object placement, point-cloud georeferencing + elevation, lane-based ego localization, sensor-fusion tracking, scenario-event extraction (cut-ins, hard brakes, near-misses, ADAS disengagements), or export to RoadRunner, drivingScenario, OpenDRIVE, OpenCRG, OpenSCENARIO, or Unreal Engine. Also: log-to-scenario, scenario harvesting, accident/near-miss reconstruction, SOTIF (ISO 21448) and ISO 26262 scenario coverage, USGS-aerial-lidar scene augmentation, traffic-sign placement from camera+lidar logs. NOT for raw-data import or multi-sensor sync/crop/offset/timestamp normalization — route those to matlab-driving-data-importer.

roadrunner-asset-mappingSkill

>

roadrunner-convert-lanelet2-to-rrhdSkill

>

roadrunner-import-sceneSkill

>

roadrunner-rrhd-authoringSkill

>

matlab-build-simbiology-modelSkill

Build, modify, and diagram SimBiology models — API reference, helper functions, and layout patterns. Use when constructing or editing models programmatically or visually.