Visually similar pcbstack objects resulting in different S parameter responses
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Mathworks community,
For the last couple of days I have been playing around with the antenna toolbox. I ran into a strange phenomenon when calculating the S parameters for an antenna configuration.
In my simulation, I am trying to take an antenna design and change the top layer to a parameterized version so that I can optimize the shape of the antenna. I added the pcbStack object describing the original antenna design in the attachment. The following code shows the steps I take to replace the top layer with the parameterized version:
clear all
close all
clc
% load the original antenna design
load("simplified_antenna.mat")
p.FeedViaModel = "octagon";
antenna_0 = p;
% define the parameterized version of the top layer
start = [7.74,8.73]*10^-3;
a = 0.999*10^-3;
b = 2.53*10^-3;
c = 4.1*10^-3;
d = 3.13*10^-3;
e = 1.4*10^-3;
f = 6*10^-3;
g = 1.3*10^-3;
h = 0.5*10^-3;
R = 0.35*10^-3;
ant1 = antenna.Rectangle( Length=g+h,Width=a, center=start+[-(g+h)/2,+a/2]);
ant2 = antenna.Rectangle( Length=h,Width=f+a, center=start+[-g-h/2,(a+f)/2]);
ant3 = antenna.Rectangle( Length=e,Width=a, center=start+[-g-h-e/2,a/2]);
ant4 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,a/2]);
ant5 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b/2]);
ant6 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b-a/2]);
ant7 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b-a+b/2]);
ant8 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b-a*1.5]);
ant9 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b+b-a-a+b/2]);
ant10 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b-a*2.5]);
ant11 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b+b+b-a-a-a+b/2]);
ant12 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b+b-a*3.5]);
ant13 = antenna.Rectangle( Length=a,Width=d, center=start+[-g-h-e-c+a/2,b+b+b+b-a-a-a-a+d/2]);
ant14 = antenna.Circle(center=start+[-g-h/2,f+a], Radius=R);
Newobj = ant1+ant2+ant3+ant4+ant5+ant6+ant7+ant8+ant9+ant10+ant11+ant12+ant13+ant14;
% check if the parameterized and original version are the same:
figure
show(p.Layers{1,2})
title("Original top layer")
figure
show(Newobj)
title("Parameterized top layer")
% calculate the S parameters
spar_0 = sparameters(antenna_0, (2:0.1:4)*10^9);
figure
rfplot(spar_0);
title("S parameter original design")
antenna_1 = antenna_0;
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
spar_1 = sparameters(antenna_1, (2:0.1:4)*10^9);
figure
rfplot(spar_1);
title("S parameter parameterized version 1")
antenna_2 = antenna_0;
antenna_2.Layers{1,2} = Newobj;
spar_2 = sparameters(antenna_2, (2:0.1:4)*10^9);
figure
rfplot(spar_2);
title("S parameter parameterized version 2")
To make sure that the parameterization is correct, I take two steps. First I check if the original and paramterized version look the same. The result is as follows and shows a nearly similar polygon:
After this, I calculate the S parameters of the resulting antenna design. This is where the strange phenomenon occurs. As the code shows, I add the parameterized top layer to the antenna design in two different ways: antenna_1.Layers{1,2}.Vertices = Newobj.Vertices; and antenna_2.Layers{1,2} = Newobj;. The resulting pcbStack objects are identical but give a significantly different simulation result as shown below:
My question is: How can these two simulations (version 1 and version 2) be significantly different even though the pcbStack objects corresponding to these two simulations are identical. On top of this, how do I know which of the two is the correct simulation. Am I missing a crucial difference between the two antennas designs?
My guess is that something is wrong with antenna design version 2 since the S parameter behaviour differs so much from the original antenna design's S parameter behaviour. It is very unlikely that this huge difference is caused by the minimal difference between the original toplayer and parameterized top layer definitions.
Best regards,
Richard Eveleens
0 Kommentare
Akzeptierte Antwort
Arnav
am 31 Jul. 2024
Although the shapes you provided look similar, they are quite different in terms of the numbers of vertices describing the boundary. This can be easily seen by plotting the boundary of both the shapes:
original_vertices = p.Layers{2}.Vertices;
parameterized_vertices = Newobj.Vertices;
plot(original_vertices(:, 1), original_vertices(:, 2), 'bo-', 'DisplayName', 'Original');
hold on
plot(parameterized_vertices(:, 1), parameterized_vertices(:, 2), 'ro-', 'DisplayName', 'Parameterized');
legend
hold off
This is the result:
The parameterized shape is quite a bit different especially around the circular region.
I tried running the code you provided and generated 3 graphs which were the same as what you provided. One interesting thing to note is that during execution there were 2 progress bars (instead of 3) corresponding to the sparameters calls. And after the first progress bar was completed, immediately 2 figures were generated and after the second progress bar was completed, the third figure was generated.
I tried running the code corresponding to the version 1 in a separate file:
antenna_1 = antenna_0;
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
spar_1 = sparameters(antenna_1, (2:0.1:4)*10^9);
figure
rfplot(spar_1);
title("S parameter parameterized version 1")
I got the output as:
This would mean that the code:
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
did not change the property correctly.
I have previously encountered a similar issue while working with pcbStack objects and the sparameters function. The explanation and workaround are provided below:
Here, changing the property of child is not reflecting the change in parent. Assigning the child object (newObj) directly does change the response given by sparameters.
Therefore, the result of the call to sparameters using the original pcbStack object is used again for version 1 whereas the second version sets the Layers{1,2} property directly so a change is seen in the response.
So, the correct S parameter response is the third graph.
It is preferred to do assignments to properties directly as given in the example:
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu PCB Antenna and Fabrication finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!