I am trying to simulate a PCB antenna, with individual layers and via drill size/locations imported from a Gerber file/layers output. I can import this with the "pcbStack" command. However, I loose the original orientation and x-y coordinates. And I cannot create a feed point, properly, for the antenna. How do I do that?

回答 (1 件)

Umar
Umar 約3時間 前

0 投票

Hi @Scott,
Two things going on here, both expected behavior on MathWorks' side (not a bug):
Feed points: Gerber files don't carry any feed information at all — MathWorks says this outright in their Gerber-import example. So pcbStack always drops the default feed at (0,0), no matter what your actual board geometry looks like. You have to set it yourself after import:
pb = pcbStack(P1);
pb.FeedDiameter = .001;
pb.FeedLocations(1:2) = [0, 0.035]; % your real feed x,y
Coordinates/orientation: the imported polygon keeps whatever raw origin was baked into the Gerber file itself, which is often not centered or aligned the way you'd expect. Before building the pcbStack, pull the polygon and re-anchor it to something you understand:
p1 = PCBReader(StackUp=S);
s = p1.shapes;
[x,y] = centroid(s);
translate(s,[-x, -y, 0]); % or use boundingbox() for an asymmetric board
Once it's in a frame you understand, build the pcbStack from that shape and set FeedLocations relative to that same origin — that combo is likely what's been tripping you up.
One other thing worth double-checking: gerberRead only supports up to two metal layers and doesn't support cut-ins. If your board has more layers than that, that alone could explain missing geometry after import.
No automatic rotation happens on import as far as I can tell — if orientation looks off, it's most likely the same root-cause as #2: the raw Gerber coordinates don't match your mental picture of the layout, not the toolbox flipping anything. MathWorks has worked examples for all of this — search "Create Antenna Model from Gerber Files" and "Translate Center of Imported Symmetrical/Asymmetrical Polygon" in the Antenna Toolbox docs.
Hope this helps!

カテゴリ

ヘルプ センター および File ExchangeGet Started with Antenna Toolbox についてさらに検索

質問済み:

約22時間 前

回答済み:

約15時間 前

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by