Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The simulation results of cpw structure don't consist with other software #324

Open
WEIXUEP opened this issue Jan 2, 2025 · 11 comments
Open
Labels
bug Something isn't working

Comments

@WEIXUEP
Copy link

WEIXUEP commented Jan 2, 2025

Hi, i am simulating a impedance matching structure using palace, this structure transforms impedance from 5 Ohm to 50 Ohm. However, a phase shift was observed when compared with other software (FEM of HFSS, MoM of Cadence).

The structure is as follows (Substrate er=3.66, tanD=0.004, H=0.508mm):
image

A similar model is created in HFSS:
image

The simulation results are:
image

I am not sure if this issue arises from the json configuration or the mesh. I tried changing some of the modeling settings, or using a denser mesh, but it had little effect.

The simulation results of HFSS and PALCE (s2p):
results.s2p.tar.gz

Port-S file (csv):
port-S_P1.csv
port-S_P2.csv

Mesh file and json file:
mesh_json.zip

HFSS Project:
20241230_PALACE_HFSS.aedt.zip

@WEIXUEP WEIXUEP added the bug Something isn't working label Jan 2, 2025
@WEIXUEP
Copy link
Author

WEIXUEP commented Jan 2, 2025

Besides, i set "CrackDisplacementFactor" : 0.0 (issue #319)

@hughcars
Copy link
Collaborator

hughcars commented Jan 2, 2025

Hello @WEIXUEP,

I lack access to an HFSS license, so am unable to inspect those HFSS files in any meaningful way. That plot doesn't immediately convince me that there is a bug however, but suggests there is likely some other divergence between your configuration and those of the HFSS model. The Palace results look reasonable, despite not being identical to HFSS and Cadence.

Have you checked they are identical problem setups? I am assuming that no amr is being performed in hfss or cadence.

  1. Is the external boundary condition identical? Palace is using a first order absorbing boundary condition, what is the external boundary condition in HFSS?
  2. What is the scale in that plot? You are saying "similar" model created in HFSS, suggesting it's not identical, in that the mesh generated within HFSS and that used with Palace (generated with gmsh it looks like?) then you could very easily get different results as you will not be fully resolved. I'm not aware of a way to pass meshes between HFSS and external systems.
  3. Have you done a refinement study? Refining the mesh and/or increasing the polynomial order, do you arrive at a converged solution between the three systems
  4. What does the HFSS mesh look like compared to the mesh used in Palace?

@WEIXUEP
Copy link
Author

WEIXUEP commented Jan 9, 2025

Hello @hughcars , i have spent several days on this problem, and i find some reasons.

Discontinuities present in the excitation ports can exert an impact on the simulation outcomes, potentially leading to discrepancies when compared to real-world operating conditions. For instance:
image

Consequently, in Cadence AWR and Keysight ADS, an additional de-embedding procedure is carried out. Detailed information regarding this can be retrieved from "Cadence AWR Design Environment Help".
image

Briefly, to conduct the port de-embedding, multi-simulation is needed. The target structure should be simulated first, then the de-embedding structure. The de-embedding structure is relatively straightforward, typically consisting of a single line with a width matching that of the port.

During the solving phase, a probe needs to be positioned at the center of the line to monitor the voltage and current. It is my belief that this process aligns with the voltage and current detection logic employed at the port.

For a single line, it should be driven in both even and odd modes. To put it simply, two ports must be excited simultaneously. First, use signals with the same phase to excite the simple microstrip line and complete a simulation (while obtaining the current and voltage readings at the probe). Subsequently, employ a signal with a 180-degree phase difference to drive the simple microstrip line once again (and record the current and voltage values at the probe).

image

Hence, the questions that arise are: How can I place a probe precisely at the center of the CPW and effectively monitor the current and voltage? Additionally, how can I excite two ports with a 180-degree phase difference? Moreover, I presume that exciting two ports with the same phase can be readily accomplished by setting the "Excitation" of both ports to "True".

"LumpedPort": [
  {
    "Index": 1,
    "R": 50, // Ω, 2-element uniform
    "Attributes": [
      3
    ],
    "Direction": "+Z",
    "Excitation": true
  },
  {
    "Index": 2,
    "R": 50, // Ω, 2-element uniform
    "Attributes": [
      4
    ],
    "Active": true,
    "Excitation": true,
    "Direction": "+Z"
  }

]

@hughcars
Copy link
Collaborator

hughcars commented Jan 9, 2025

I'm glad you're making some progress. In terms of de-embedding, we do not do that within Palace presently, as you describe it you might be able to do this by running two simulations yourself and then combining the results yourself.

Driving two ports simultaneously in phase can indeed be done by setting "Excitation": true on the two ports. Right now we do not have support for driving them with a phase difference, but this is something we have been considering adding in the future, we just hadn't had impetus to yet (and we would need to plan out the interface etc.). I believe this wouldn't be especially difficult to add, but we would need to be a little careful in implementing it. This would also overlap a lot with the current work underway on multi-excitation, so should be downstream of that.

In terms of measuring the field at a probe location, we have the ability to place probes, see the documentation here. The rings example in particular has some probes placed which should demonstrate their usage.

Given you're very carefully characterizing this device, I wonder if you might want to use the wave ports instead? Lumped ports introduce some modeling inaccuracy when analyzing this kind of interaction, which if I am understanding you correctly, is what this de-embedding is removing (see the cpw example in the documentation for an example). I'm not sure if that would be helpful for your particular usage, but this would necessitate bringing your boundary geometry in to the edge of the device, as wave ports need to be external boundaries.

@sebastiangrimberg
Copy link
Contributor

sebastiangrimberg commented Jan 9, 2025

Regarding imposing two excitations with 180 degree phase difference, this is actually something you can do with lumped ports. You can flip the sign of the "Direction" value for one of the ports, that is, use "+Z" and "-Z" instead of "+Z"and"+Z", which will lead to opposite sign E-field excitations along the given direction and corresponds to a 180 degree phase mismatch.

This is actually also possible with wave ports though not currently exposed to the user. There is a normalization in waveportoperator.cpp which uses a certain abitrary sign convention for the polarization of the computed wave port mode. You could multiply this by -1 on one of the ports to shift the phase by 180 degrees. For wave ports we can even do better, since we have the full complex phasor for excitation we can multiply by exp(i * \phi) to impose a phase shift of \phi radians.

@WEIXUEP
Copy link
Author

WEIXUEP commented Jan 10, 2025

@hughcars @sebastiangrimberg, thank you for your reply, wave ports could be more accurate, however it must be connected to boundary, which could lead to inconvenience for some complex designs.

After your reminder, i guess the de-embedding procedure can be easily carried out using a lumped port and a wave port, thus we can model the discontinuity of one lumped port. However, in traditional methods, the single line need to be driven in even mode and then in odd mode to get the discontinuity of one lumped port. I will further explore the differences in the results of these two methods.

The phase problem can be solved by using "+Z" and "-Z" instead of "+Z"and"+Z". In terms of the measurement of voltage and current, i have tried the probe in example "cpw". The probe only returns the electric field strength and magnetic flux density.

For the calculation of voltage, I guess I can use the electric field (Ez) integral from GND to pec in the z direction to calculate. In this process, do I need to set up multiple probes in "+Z" direction for discrete integration?

For the calculation of current, i guess i should use magnetic field strength rather than magnetic flux density. So i can using:
image
All materials modeled here have a relative permeability of 1, so the calculation should be simple, but what if the permeabilities are different across models? Most importantly, the integration of the magnetic field can give the current. In FDTD, the integration is performed on the edge of a plane.
image
In Palace, how do I set up the probe to calculate the sampled magnetic field and calculate the current? I guess I can set up multiple probes on the surface of the PEC for integration.
image

@hughcars
Copy link
Collaborator

One issue with using probes like that for line integration is that you'll be integrating something non-polynomial, so there's no valid quadrature you can use, meaning you'll get very poor convergence of the integrated quantity. If you can instead achieve what you're looking for with a surface integral rather than a line integral, then you might be in luck, right now Palace can calculate $\int_S \epsilon E \cdot \vec{n} dA$ and $\int_S B \cdot \vec{n} dA$, the fluxes through prescribed surfaces.

If you can formulate what you're wanting to calculate as 2D integrals (they can be over very narrow strips), I can possibly add the necessary postprocessing coefficients for performing the integration if they're not shown in the docs.

For the electric integration, when you say from GND to the PEC, where are you defining ground to be? For driven simulations this seems to be not very well defined. For the magnetic integration you're describing, given you're describing a current, I am thinking you're meaning a closed line integral around the edge of a plane, which from Stokes theorem is equivalent to the flux of the curl of the field through the bound surface. I.e. $\int_S \nabla \times \vec{B} \cdot \vec{n} dS$, is that what you're intending?

At a high level, this is a lot of work to do multi-simulations and combined the data, to make up for the modeling error of using lumped-ports, wheras this is something waveports can do naturally, as de-embedding is relatively simple, and already implemented within Palace. This is then done with one simulation, as the de-embedding models the effect of the port extending off to some user specified distance outside of the model. To perform either approach you're going to need to modify your model. For the lumped port case you'll need to add in appropriate surfaces to perform integrals over, and establish what this integrals need to be, then perform the multiple simulations you've suggested, then combine the data. For a waveport, you'll need to pull the boundary in to the edge of the geometry but then after that it's one simulation and trivially done in the configuration file.

@WEIXUEP
Copy link
Author

WEIXUEP commented Jan 16, 2025

@hughcars Thank for you response, I was a bit busy recently and didn't reply in time. I understand the advantages of wave ports, but I still want to know the difference in the results of these two de-embedding methods. I will reply again if I have the verification result.

I am sorry that my statement caused misunderstanding. For the electric integration, i say from GND to the PEC. In computational electromagnetics, these are both PEC. But in microwave circuits, one acts as GND and the other acts as Signal Line, as:

Image

Hi, After reading the code carefully, i found the Wave ports and lumped ports can not be used in one structure, as:

Image

If I want to model the discontinuity of a port using one simulation, I need to set one lumped port and one wave port in the simulation, which seems to be unachievable?

@WEIXUEP
Copy link
Author

WEIXUEP commented Jan 16, 2025

@hughcars I have a simplified methods to measure voltage and current. I can add a lumped port at the target position, and set the resistance to be a very large value, then this port can act as a ideal probe. And the voltage and current can be achieved from port-V.csv and port-I.csv. But I think this method may introduce some errors.


OK, i looked through the code, and found the current is calculated by vi.V / data.GetCharacteristicImpedance(omega, LumpedPortData::Branch::R), the above method may not be possible.

Using Stokes theorem to calculate the current may not be easy for me, calculating current using curl seems to be more difficult than using loop integration. Unless I modify the code directly, for example, using Curl.Mult() function to calculate curl.

Image

Hi, i found this function:

Image

If i can calculate curl of mfem::ParGridFunction *B, i can solve the current probe problem. I think it's not difficult, because there might be some existing functions that can be used. But I didn't find it in the doxygen documentation of mfem, could you give me some advice?

@CosimoMV
Copy link

Hi @WEIXUEP I'm using lumped ports to do some simulations (in my case a very simple coupled stripline) in the GHz range too. Unfortunately I get some strange S-parameters, but I am still investigating the problem...
Regarding a method to measure the voltage from A to B there is this topic (maybe you could find it useful): #172 (comment)

@hughcars
Copy link
Collaborator

@hughcars I have a simplified methods to measure voltage and current. I can add a lumped port at the target position, and set the resistance to be a very large value, then this port can act as a ideal probe. And the voltage and current can be achieved from port-V.csv and port-I.csv. But I think this method may introduce some errors.

OK, i looked through the code, and found the current is calculated by vi.V / data.GetCharacteristicImpedance(omega, LumpedPortData::Branch::R), the above method may not be possible.

Using Stokes theorem to calculate the current may not be easy for me, calculating current using curl seems to be more difficult than using loop integration. Unless I modify the code directly, for example, using Curl.Mult() function to calculate curl.

Image

Hi, i found this function:

Image

If i can calculate curl of mfem::ParGridFunction *B, i can solve the current probe problem. I think it's not difficult, because there might be some existing functions that can be used. But I didn't find it in the doxygen documentation of mfem, could you give me some advice?

Right now evaluating curl(B) is not done within Palace, but the resulting field would be approximately represented in an ND space, following the ideas in https://mfem.org/maxwell-notes/ in particular the section Weak curl of μ−1B. The Curl operator you are referencing there maps from ND -> RT whereas the one you want effectively maps from RT -> ND, but can only do so in a weak sense, as there is no exact embedding (unlike from ND -> RT). Computing the curl of an RT field, and then integrating it over a surface would be pretty helpful here I think, but doesn't exist as a linear form integrator within mfem right now so we would need to do some work to create it.

Hi, After reading the code carefully, i found the Wave ports and lumped ports can not be used in one structure, as:

Constructing S_ij between a lumped and wave port is not possible presently because we haven't implemented it. There's some work to be done in ensuring a consistent normalization between the two approaches which we intend to get to but haven't had the bandwidth for just yet. For instance GetPortVoltage and GetPortCurrent aren't implemented for Waveports right now due to some ambiguity, we are intending to resolve this in future following the ideas of https://www.nist.gov/publications/general-waveguide-circuit-theory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants