Skip to main content
ClaudeWave
Skill618 repo starsupdated 8d ago

matlab-assemble-pcb-layout

This skill assembles custom PCB structures using shape primitives, Boolean operations, and multi-layer stackups when non-catalog geometries are needed. Use it to build defected ground structures, stripline configurations, custom feed placements, and complex metal patterns on individual layers before proceeding to electromagnetic analysis or design optimization.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-assemble-pcb-layout && cp -r /tmp/matlab-assemble-pcb-layout/skills-catalog/rf-and-mixed-signal/matlab-assemble-pcb-layout ~/.claude/skills/matlab-assemble-pcb-layout
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Assembling Custom PCB Components

## When to Use

- Building custom PCB structures that aren't covered by catalog objects (microstripLine, coupledMicrostripLine, etc.)
- Constructing multi-layer stackups with custom metal shapes on each layer
- Combining shape primitives with Boolean operations (union, subtract, intersect)
- Creating defected ground structures (DGS) by etching patterns into ground planes
- Placing feed ports, vias, or using advanced FeedDefinitions (coaxial, edge, delta-gap)
- Assembling stripline or shielded enclosure structures

## When NOT to Use

- Designing standard transmission lines — use `matlab-design-pcb-txline`
- Importing layouts from Gerber, ODB++, or Allegro — use `matlab-read-pcb-layout`
- Defining dielectric or metal materials — use `matlab-manage-pcb-material`
- Running EM analysis after assembly — use `matlab-analyze-em`
- Cascading or connecting multiple pcbComponents — use `matlab-integrate-pcb-circuit`

## Typical Workflow

1. **Before:** `matlab-manage-pcb-material` — set up substrate and conductor
2. **This skill:** Build the custom PCB structure using pcbComponent, shapes, and feeds
3. **After:** `matlab-analyze-em` — validate S-parameters → `matlab-optimize-pcb-design` — tune dimensions → `matlab-write-pcb-layout` — export Gerber

## Quick Reference

| Task | Code |
|------|------|
| Create pcbComponent | `pcb = pcbComponent` |
| Assign layers | `pcb.Layers = {signal, substrate, ground}` |
| Set board shape | `pcb.BoardShape = ground` |
| Set thickness | `pcb.BoardThickness = 1.6e-3` |
| Place feeds | `pcb.FeedLocations = [x1 y1 1 3; x2 y2 1 3]` |
| Feed diameter | `pcb.FeedDiameter = W/2` |
| Set conductor | `pcb.Conductor = metal("Copper")` |
| Add vias | `pcb.ViaLocations = [x y topLayer botLayer]` |
| Visualize | `show(pcb)` |
| Layout view | `layout(pcb)` |
| Boolean union | `shape = s1 + s2` |
| Boolean subtract | `shape = s1 - s2` |
| Boolean intersect | `shape = s1 & s2` |

## pcbComponent Anatomy

`pcbComponent` is the universal container for custom RF PCB structures.

### Minimal 2-Layer Microstrip

```matlab
pcb = pcbComponent;
substrate = dielectric("FR4");
substrate.Thickness = 1.6e-3;

signal = traceRectangular(Length=20e-3, Width=3e-3);
ground = traceRectangular(Length=30e-3, Width=20e-3);

pcb.Layers = {signal, substrate, ground};
pcb.BoardShape = ground;
pcb.BoardThickness = substrate.Thickness;
pcb.Conductor = metal("Copper");
pcb.FeedDiameter = 1.5e-3;
pcb.FeedLocations = [-10e-3 0 1 3; 10e-3 0 1 3];
show(pcb);
```

### 5-Layer Stripline Structure

```matlab
pcb = pcbComponent;
sub = dielectric(Name="FR4", EpsilonR=4.4, LossTangent=0.02, Thickness=0.8e-3);

topGnd = traceRectangular(Length=40e-3, Width=20e-3);
signal = traceRectangular(Length=30e-3, Width=2e-3);
botGnd = traceRectangular(Length=40e-3, Width=20e-3);

pcb.BoardThickness = 2 * sub.Thickness;          % Set BEFORE Layers
pcb.Layers = {topGnd, sub, signal, sub, botGnd};
pcb.BoardShape = topGnd;
pcb.Conductor = metal("Copper");
pcb.FeedLocations = [-15e-3 0 3 1; 15e-3 0 3 5];
pcb.FeedDiameter = 1e-3;
show(pcb);
```

### Key Properties

| Property | Format | Description |
|----------|--------|-------------|
| `Layers` | Cell array | Alternating: metal shape, dielectric, metal shape, ... |
| `BoardShape` | Shape object | Outer boundary of the PCB |
| `BoardThickness` | Scalar (m) | Must equal sum of dielectric thicknesses |
| `FeedLocations` | N×4 matrix | `[x, y, signalLayer, groundLayer]` per port |
| `FeedDiameter` | Scalar (m) | Diameter of feed via/probe |
| `ViaLocations` | M×4 matrix | `[x, y, topLayer, bottomLayer]` per via |
| `ViaDiameter` | Scalar (m) | Via barrel diameter |
| `FeedViaModel` | String | `'strip'`, `'square'`, `'octagon'`, `'hexagon'` |
| `Conductor` | metal object | Conductor for all metal layers |
| `SolverType` | String | `'MoM'` or `'FEM'` |

## Shape Primitives

### Rectangular Traces

```matlab
rect = traceRectangular(Length=20e-3, Width=5e-3, Center=[0 0]);
```

### Line Traces (multi-segment with bends)

```matlab
tl = traceLine;
tl.Length = [10 5*sqrt(2) 10]*1e-3;
tl.Angle = [0 45 0];
tl.Width = 3e-3;
tl.Corner = 1;          % 1 = Miter, 2 = Smooth (default: Sharp)
show(tl);
```

### Point-Defined Traces

```matlab
tp = tracePoint;
tp.TracePoints = [0 0; 10e-3 0; 15e-3 5e-3; 25e-3 5e-3];
tp.Width = 2e-3;
tp.Corner = 2;          % 2 = Smooth
```

### Spiral Traces

```matlab
sp = traceSpiral;
sp.NumTurns = 3;
sp.InnerDiameter = 4e-3;
sp.Spacing = 0.5e-3;
sp.TraceWidth = 0.5e-3;
show(sp);
```

### Tapered Traces

```matlab
tt = traceTapered;
tt.Length = 10e-3;
tt.InputWidth = 1e-3;
tt.OutputWidth = 3e-3;
```

### Bends

Bend `Width` is a 2-element vector `[w1 w2]` for the two arms:

```matlab
bc = bendCurved;
bc.Width = [2e-3 2e-3];
bc.CurveRadius = 5e-3;

bm = bendMitered;
bm.Width = [2e-3 2e-3];

br = bendRightAngle;
br.Width = [2e-3 2e-3];
```

### U-Bends

U-bend `Width` is a 3-element vector `[arm1 bottom arm2]`:

```matlab
uc = ubendCurved;
uc.Width = [2e-3 2e-3 2e-3];
uc.CurveRadius = 3e-3;

um = ubendMitered;
um.Width = [2e-3 2e-3 2e-3];
```

### Other Shapes

```matlab
d = delta;
d.OuterRadius = 5e-3;                           % Triangle/delta

db = dumbbell;
db.SideLength = 6e-3;                           % Head size (square Type, default)
db.ArmLength = 10e-3;
db.ArmWidth = 0.5e-3;                           % Dumbbell (for DGS)
% Note: Type='Square' uses SideLength; Type='Circle' uses Diameter

rt = racetrack;
rt.Length = 15e-3;
rt.Width = 5e-3;                                % Racetrack

rd = radial;
rd.OuterRadius = 5e-3;
rd.Angle = 60;                                  % Radial sector

ar = ringAnnular;
ar.InnerRadius = 1e-3;
ar.Width = 4e-3;                                % Annular ring (InnerRadius must be > 0)

sr = splitRing;
sr.RingDiameter = 10e-3;
sr.TraceWidth = 0.5e-3;
sr.SplitGap = 0.5e-3;                           % Split ring resonator
```

## Boolean Operations

Combine shapes using operators to build comple
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.