Error using delaunayTriangulation when calling mesh() on a pcbStack

5 visualizzazioni (ultimi 30 giorni)
Hi! this is the first time I ask a question here I hope im doing everthing right. Well, I'm trying to simulate the EH fields of a 2 layer pcb coil, I import the files and make the pcbStack with the following code:
P = gerberRead("gerber/6L_planar_transformerv3-F_Cu.gbr", ...
"gerber/6L_planar_transformerv3-In1_Cu.gbr", ...
"gerber/6L_planar_transformerv3-PTH.drl");
pb2 = pcbStack(P);
f_cu=pb2.Layers{2};
in1_cu=pb2.Layers{4};
p = pcbStack;
p.BoardThickness=0.203e-3*1+1e-3;
p.ViaDiameter=0.1e-3;
d1 = dielectric("FR4");
d1.Thickness = 0.203e-3;
air = dielectric("Air");
air.Thickness = 1e-3;
p.BoardShape = antenna.Rectangle(Length=60e-3, Width=60e-3,Center=[0.1187 -0.0775]);
%p.Layers = {f_cu,d1,in1_cu,d1,in2_cu,d1,in3_cu,d1,d1,in4_cu,d1,b_cu};
p.Layers={air,f_cu,d1,in1_cu,air}
p.FeedDiameter = 0.1e-3;
p.FeedLocations = [146.1e-3 -72e-3 2;]
p.ViaLocations = [143e-3 -77.5e-3 2 4;
117.5e-3 -77.5e-3 2 4]
show(p)
The reason I'm importing the pcbStack like that is that I'm planning on simulating a planar transformer EH fields and the gerberRead() only allows for 2 layered pcb, this way i can add more layers by importing more gerber files. However when I run
mesh(p)
After some 20 minutes of the program running, it returns the following errors:
Error using delaunayTriangulation
Enforcing Delaunay constraints leads to unstable repeated constraint intersections.
This may be due to near coincident intersecting constraints or near duplicate points.
Error in em.internal.meshprinting.inter6_full_mesh
Error in em.internal.meshprinting.multiLayerMetalImprint
Error in em.PCBStructures/generateMeshForStripFeedAndVia
Error in pcbStack/meshGenerator (line 1340)
Mesh = generateMeshForStripFeedAndVia(obj,mesherInput);
Error in em.MeshGeometry/updateMeshForPcbStack
Error in em.MeshGeometry/protectedmesh
Error in em.MeshGeometryAnalysis/mesh (line 66)
protectedmesh(obj,varargin{:});
And since some functions of the RF toolbox like current() EHFields() first call mesh() I cant run simulations of my design. I don't know if the size could be the reason of the delaunayTriangulation failure or something is wrong with my setup

Risposte (1)

Umar
Umar il 7 Ott 2024

Hi @Fernando ,

After carefully reviewing the following documentations provided at the links below

https://www.mathworks.com/help/antenna/ref/gerberread.html?searchHighlight=gerberRead&s_tid=srchtitle_support_results_1_gerberRead

https://www.mathworks.com/help/antenna/ref/pcbstack.html?searchHighlight=generateMeshForStripFeedAndVia&s_tid=srchtitle_support_results_1_generateMeshForStripFeedAndVia

To address the Delaunay triangulation error you're encountering when running mesh(p), please see a few potential solutions and considerations listed below

Check for Near-Duplicate Points

The error message indicates that there might be nearly coincident points in your design. You can check for duplicates by examining your FeedLocations and ViaLocations. Ensure that none of these points are too close together. A simple approach is to apply a tolerance when comparing points. Example code snippet to filter out duplicates:

     tolerance = 1e-6; % Adjust as necessary
     uniqueFeedLocations = unique(p.FeedLocations, 'rows', 'stable');
     uniqueViaLocations = unique(p.ViaLocations, 'rows', 'stable');

Simplify Geometry

If your PCB design has complex geometries, try simplifying it. This can involve reducing the number of layers temporarily or simplifying shapes within the Gerber files to see if that resolves the meshing issue.

Adjust Layer Configuration

Ensure that your layer configuration is correctly set up in terms of their order and materials. Each layer should be properly defined with respect to its dielectric properties and thickness.Confirm that all specified layers (including air layers) are correctly defined and not conflicting with each other.

Visual Inspection

Use show(p) after constructing your pcbStack object to visually inspect how your PCB looks before meshing. This may help you identify any immediate geometric issues that could lead to problems during meshing.

Review Gerber Files

Since you are importing multiple Gerber files, ensure that they are compatible with RS-274X standards and do not contain unsupported features such as cut-ins, aperture macros, etc., as mentioned in the documentation. You may also want to visualize individual layers using shapes(P) to ensure they are being read correctly.

Increase Mesh Resolution

Sometimes adjusting the meshing parameters can help. You can try modifying settings related to mesh resolution or constraints if applicable.

Debugging via Smaller Models

As a debugging step, try simulating a simpler PCB model first. If that works, gradually add complexity until you isolate what specifically causes the failure in your original design.

MATLAB Version Compatibility

Ensure that you are using a version of MATLAB that supports all functions and features you are trying to utilize, particularly concerning RF Toolbox updates.

Familiarize yourself with MATLAB's documentation on delaunayTriangulation and pcbStack for more detailed insights into managing points and constraints effectively. Monitor system performance while running simulations; sometimes computational limits can exacerbate issues in complex models.

By following these strategies, you should be able to troubleshoot and resolve the Delaunay triangulation error effectively, allowing you to proceed with simulating the EH fields of your planar transformer design.

Hope this helps.

Please let me know if you still have any further questions.

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by