matlab-design-pcb-passive
This skill designs passive RF components including spiral inductors, interdigital capacitors, baluns, resonators, and phase shifters for PCB applications. Use it when you need to create, configure, and extract electrical properties from discrete passive elements like coupled-line baluns, ring resonators, or Schiffman phase shifters. Do not use it for transmission line, filter, coupler, or EM analysis tasks, which have dedicated skills.
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-design-pcb-passive && cp -r /tmp/matlab-design-pcb-passive/skills-catalog/rf-and-mixed-signal/matlab-design-pcb-passive ~/.claude/skills/matlab-design-pcb-passiveSKILL.md
# Designing Passive Components
## When to Use
- Designing spiral inductors or interdigital capacitors for RF circuits
- Extracting inductance, capacitance, or self-resonant frequency from passive components
- Creating ring or split-ring resonators for filtering or metamaterial applications
- Designing coupled-line or Marchand baluns for balanced-to-unbalanced conversion
- Building Schiffman phase shifters or radial stubs
## When NOT to Use
- Designing transmission lines (microstrip, stripline, CPW) — use `matlab-design-pcb-txline`
- Designing filters (bandpass, lowpass, bandstop) — use `matlab-design-pcb-filter`
- Designing couplers or splitters — use `matlab-design-pcb-coupler`
- Setting up substrate materials — use `matlab-manage-pcb-material`
- Running EM analysis after design — use `matlab-analyze-em`
## Typical Workflow
1. **Before:** `matlab-manage-pcb-material` — set up substrate and conductor
2. **This skill:** Design the passive component (inductor, capacitor, balun, resonator)
3. **Check mesh/memory:** `memoryEstimate(obj, fc, 'RetainMesh', true)` — inspect auto-mesh density before committing to a full solve
4. **After:** `matlab-analyze-em` — validate S-parameters → `matlab-optimize-pcb-design` — tune dimensions → `matlab-integrate-pcb-circuit` — cascade into circuit
## Quick Reference
| Task | Code |
|------|------|
| Spiral inductor | `ind = spiralInductor` |
| Interdigital capacitor | `cap = interdigitalCapacitor` |
| Extract inductance | `L = inductance(ind, freq)` |
| Extract capacitance | `C = capacitance(cap, freq, DeEmbed=true)` |
| Behavioral S-params | `S = sparameters(obj, freq, Behavioral=true)` |
| Ring resonator | `r = design(resonatorRing, freq)` |
| Split-ring (custom) | `r = resonatorSplitRingCustom` |
| Split-ring (square) | `r = resonatorSplitRingSquare` |
| Coupled-line balun | `b = balunCoupledLine` |
| Marchand balun | `b = balunMarchand` |
| Phase shifter | `ps = design(phaseShifter, freq, PhaseShift=90)` |
| Radial stub | `stub = stubRadialShunt` |
| Optimize | `optimize(obj, freq, ...)` |
## Spiral Inductors
### Creating and Configuring
```matlab
ind = spiralInductor;
ind.SpiralShape = 'Square'; % 'Square' | 'Circle' | 'Hexagon' | 'Octagon'
ind.InnerDiameter = 5e-4;
ind.Width = 2.5e-4;
ind.Spacing = 2.5e-4;
ind.NumTurns = 4;
ind.Height = 1.016e-3; % Must be a cumulative substrate layer boundary
ind.GroundPlaneLength = 5.6e-3;
ind.GroundPlaneWidth = 5.6e-3;
```
### RFIC Substrates (Silicon/SiO2)
```matlab
ind = spiralInductor;
ind.Substrate = dielectric('Name', {'Silicon','SiO2'}, ...
'EpsilonR', [11.9, 4.1], 'LossTangent', [0.005, 0], ...
'Thickness', [300e-6, 3e-6]);
ind.Height = 303e-6; % Signal trace at top of stack
```
### Spiral Shape and Q-Factor Tradeoffs
| Shape | Q-Factor | Notes |
|-------|----------|-------|
| `'Circle'` | Highest | Best electrical performance |
| `'Octagon'` | High | Close to circular; easier to fabricate |
| `'Hexagon'` | Moderate | Compromise |
| `'Square'` | Lowest | Easiest to manufacture; current crowding at corners |
### Ground Plane Proximity Effect
Smaller `Height` increases capacitive coupling to ground, reducing inductance, Q-factor, and self-resonant frequency. Account for this when the PCB stackup constrains Height.
### Inductance Extraction
```matlab
L = inductance(ind, 600e6); % Scalar frequency → scalar (H)
L = inductance(ind, linspace(100e6, 1e9, 30)); % Vector → vector
```
### Self-Resonant Frequency (SRF)
At SRF, parasitic capacitance resonates with inductance — impedance peaks, then the inductor behaves as a capacitor. Design so the operating band stays below SRF/3 to SRF/2.
```matlab
freq = linspace(100e6, 10e9, 201);
L = inductance(ind, freq);
% Sign change: L > 0 (inductive) → L < 0 (capacitive) at SRF
```
### Visualization
```matlab
show(ind)
current(ind, 600e6)
charge(ind, 600e6)
[E, H] = EHfields(ind, 4e9, [0; 0; 1]);
```
## Interdigital Capacitors
### Creating and Configuring
```matlab
cap = interdigitalCapacitor;
cap.NumFingers = 4;
cap.FingerLength = 0.0137;
cap.FingerWidth = 3.16e-4;
cap.FingerSpacing = 3e-4;
cap.FingerEdgeGap = 3.41e-4;
cap.TerminalStripWidth = 5e-4;
cap.PortLineWidth = 1.9e-3;
cap.PortLineLength = 3e-3;
cap.Height = 7.87e-4;
```
### Capacitance Extraction
```matlab
C = capacitance(cap, 5e9); % Raw
C = capacitance(cap, 5e9, DeEmbed=true); % De-embedded
C = capacitance(cap, 5e9, DeEmbed=true, IncludeParasitics=true); % With parasitics
```
- **DeEmbed** removes feed line effects to isolate the capacitor.
- **IncludeParasitics** adds parasitic inductance/resistance from the finger structure.
## Behavioral S-Parameters
Both `spiralInductor` and `interdigitalCapacitor` support fast behavioral models:
```matlab
S = sparameters(ind, freq, Behavioral=true); % ~instant
S = sparameters(cap, freq, Behavioral=true);
```
Use for initial exploration; switch to full-wave (`Behavioral=false`, the default) for validation. Before a full-wave solve, always check mesh density:
```matlab
memoryEstimate(ind, fc, 'RetainMesh', true); % Check auto-mesh before full-wave
sp = sparameters(ind, freq, 'SweepOption', 'interp');
```
## Ring Resonators
`resonatorRing` is a microstrip ring resonator coupled to two feed lines via a gap.
```matlab
r = resonatorRing;
r.RingRadiusOuter = 0.01;
r.RingWidth = 4e-3;
r.CouplingGap = 1e-3;
r.PortLineLength = 0.01;
r.PortLineWidth = 5e-3;
r.Height = 1.6e-3;
r.GroundPlaneWidth = 0.04;
```
### Frequency-Based Design
```matlab
r = design(resonatorRing, 1.8e9); % 50 Ω default
r = design(resonatorRing, 2.5e9, Z0=75); % 75 Ω
```
## Split-Ring Resonators
Two object types: `resonatorSplitRingCustom` (pluggable shape) and `resonatorSplitRingSquare` (pre-configured square>
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.
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.
>
>
>
>
Build, modify, and diagram SimBiology models — API reference, helper functions, and layout patterns. Use when constructing or editing models programmatically or visually.