Skip to content

Commit

Permalink
✨ More ports, connectivity and experiment functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Jul 29, 2024
1 parent 5493704 commit 03f3fc3
Show file tree
Hide file tree
Showing 36 changed files with 1,790 additions and 69 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ python:
path: .
extra_requirements:
- dev
- nonix

formats: []
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# As such, understanding interconnection effects turns out to be pretty important in these type of systems.

# +
import piel
import piel.experimental as pe
from piel.models.physical.electrical.cable import (
calculate_coaxial_cable_geometry,
calculate_coaxial_cable_heat_transfer,
Expand Down Expand Up @@ -172,34 +174,121 @@
#
# An important aspect to keep track of things is the configuration of the VNA.

# ## Frequency-Domain Analysis
#
# ## Performing the VNA/Deembedding Calibration
#
# We will use the calibration kit of an Agilent E8364A PNA which is nominally designed for 2.4mm coaxial cables. Using 2.4mm to 3.5mm SMA adapters is probably fine given that we're deembedding up to a given cable. Realistically, I would need to deembed the performance of the adapter between the calibration kit and the open, short, through adapter.

# #### Using a Hardware Calibration Kit
#
# Decide the two reference points at which you will connect to your device to test. This is a very common way to start doing de-embedding on a machine. In our setup, we will use the Agilent 82052D 3.5mm calibration kit. We can easily follow the instructions using our E8364A Agilent PNA. Let's assume this has been done correctly.
#
# So, we have performed the calibration of our measurement using that calibration kit. In our case, we will perform the first hardware calibration up to the black tongs as shown in the figure below.

import piel.experimental as pe
# Let's compose the experiment into a correct format. First let's create our components.

dir(pe.types)
short_1port = pe.models.short_85052D()
load_1port = pe.models.load_85052D()
open_1port = pe.models.load_85052D()
throguh_2port = pe.models.through_85052D()
vna = pe.models.E8364A()

# We can explore the parameters of these components to understand their configuration and information

# ## Frequency-Domain Analysis
#
# ## Performing the VNA/Deembedding Calibration
#
# We will use the calibration kit of an Agilent E8364A PNA which is nominally designed for 2.4mm coaxial cables. Using 2.4mm to 3.5mm SMA adapters is probably fine given that we're deembedding up to a given cable. Realistically, I would need to deembed the performance of the adapter between the calibration kit and the open, short, through adapter.
#
# I've saved the calibration under `files/vna_calibration/calibation_35mm_calkit.cst` which can be reloaded. Note it's only useful up to 20GHz. Standard amount of points is 6401 between 0-20 GHz exactly in the frequency spectrum which is about 3MHz resolution per point. Only use GHz.
#
# * TODO list of equipment
#
vna

# * S1-S2 Through
# * S6-S7 Load 50 $\Omega$
#
# ### Through S-Parameter Measurement
short_1port


def one_port_measurement_configuration(one_port_component, vna):
# Note that each measurement can be considered an experiment instance
experiment_instances = list()

# First we instantiate our short calibration connector and our VNA
components = [one_port_component, vna]

# We need to create connections between PORT1 and PORT2 accordingly, note that we need to calibrate both VNA ports.
vna_port1_connections = piel.create_component_connections(
components=components,
connection_reference_str_list=[
f"{vna.name}.PORT1",
f"{one_port_component.name}.IN",
],
)

vna_port2_connections = piel.create_component_connections(
components=components,
connection_reference_str_list=[
f"{vna.name}.PORT2",
f"{one_port_component.name}.IN",
],
)

# #### A HW Calibrated Open-Measurement
# Create the required experiment instances
for connections_i in [vna_port1_connections, vna_port2_connections]:
experiment_instance_i = pe.types.ExperimentInstance(
components=components, connections=connections_i
)
experiment_instances.append(experiment_instance_i)

return experiment_instances


# We need to do a similar thing with the remaining one ports, so let's run this now.

short_experimental_instance_list = one_port_measurement_configuration(short_1port, vna)
open_experimental_instance_list = one_port_measurement_configuration(open_1port, vna)
load_experimental_instance_list = one_port_measurement_configuration(load_1port, vna)


def two_port_measurement_configuration(two_port_component, vna):
# First we instantiate our short calibration connector and our VNA
components = [two_port_component, vna]

# We need to create connections between PORT1 and PORT2 accordingly, note that we need to calibrate both VNA ports.
vna_connections = piel.create_component_connections(
components=components,
connection_reference_str_list=[
[f"{vna.name}.PORT1", f"{two_port_component.name}.IN"],
[f"{vna.name}.PORT2", f"{two_port_component.name}.OUT"],
],
)

# Create the required experiment instance
experiment_instance = pe.types.ExperimentInstance(
components=components, connections=vna_connections
)

return experiment_instance


through_experiment_instance = two_port_measurement_configuration(throguh_2port, vna)


# Now we can create an `Experiment` from this:

rf_vna_self_calibration = pe.types.Experiment(
name="rf_vna_self_calibration",
experiment_instances=[through_experiment_instance]
+ open_experimental_instance_list
+ load_experimental_instance_list
+ short_experimental_instance_list,
)

# Let's create the directories in which to save the data accordingly:

experiment_data_directory = piel.return_path("data")
piel.create_new_directory(experiment_data_directory)

# Now, we can create the experiment in there:

propagation_delay_experiment_directory = pe.construct_experiment_directories(
experiment=rf_vna_self_calibration,
parent_directory=experiment_data_directory,
)

# ### A HW Calibrated Open-Measurement
#
# Our two unconnected ports with the calibration applied at the machine might give a measurement such as this one.
#
Expand All @@ -217,7 +306,7 @@

# This is the same data you should get if you connect the open calibration port from the calibration kit into any of the VNA ports.

# #### A HW Calibrated Short Measurement
# ### A HW Calibrated Short Measurement

# Now, let's connect a short calibration port into one of the VNA ports. You can note that obviously the insertion loss doesn't change as this is just a port to port measurement.

Expand All @@ -229,15 +318,15 @@
)
calibrated_vna_port1_short_network.plot_s_db()

# #### A HW Calibrated Load Measurement
# ### A HW Calibrated Load Measurement

calibrated_load_data_file = (
"measurement_data/calibration_kit_vna_cal_at_vna_ports/load_port1.s2p"
)
calibrated_vna_port1_load_network = hfss_touchstone_2_network(calibrated_load_data_file)
calibrated_vna_port1_load_network.plot_s_db()

# #### A HW Calibrated Through-Measurement
# ### A HW Calibrated Through-Measurement
#
# <figure>
# <img src="../../_static/img/examples/08_basic_interconnection_modelling/experimental_cal_through.jpg" alt="drawing" width="70%"/>
Expand Down Expand Up @@ -329,7 +418,6 @@
import os


# +
def construct_calibration_networks(measurements_directory: piel.PathTypes):
"""
This function takes a directory with a collection of ``.s2p`` measurements and constructs the relevant calibration measurements accordingly.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
- **name**: None
- **components**:
-
- **name**: through_82052D
- **ports**:
-
- **name**: IN
- **domain**: None
- **connector**: SMA_3.5mm
- **manifold**: 82052D
-
- **name**: OUT
- **domain**: None
- **connector**: SMA_3.5mm
- **manifold**: 82052D
- **connections**: None
- **components**:
- **environment**: None
- **manufacturer**: Agilent
-
- **name**: E8364A
- **ports**:
-
- **name**: PORT1
- **domain**: RF
- **connector**: None
- **manifold**: None
-
- **name**: PORT2
- **domain**: RF
- **connector**: None
- **manifold**: None
- **connections**: None
- **components**:
- **environment**: None
- **manufacturer**: Agilent
- **configuration**: None
- **connections**:
-
- **name**: None
- **ports**:
-
- **name**: PORT1
-
- **name**: IN
-
- **name**: None
- **ports**:
-
- **name**: PORT2
-
- **name**: OUT
- **goal**: None
- **index**: None
- **date_configured**: None
- **date_measured**: None
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": null,
"components": [
{
"name": "through_82052D",
"ports": [
{
"name": "IN",
"domain": null,
"connector": "SMA_3.5mm",
"manifold": "82052D"
},
{
"name": "OUT",
"domain": null,
"connector": "SMA_3.5mm",
"manifold": "82052D"
}
],
"connections": null,
"components": [],
"environment": null,
"manufacturer": "Agilent"
},
{
"name": "E8364A",
"ports": [
{
"name": "PORT1",
"domain": "RF",
"connector": null,
"manifold": null
},
{
"name": "PORT2",
"domain": "RF",
"connector": null,
"manifold": null
}
],
"connections": null,
"components": [],
"environment": null,
"manufacturer": "Agilent",
"configuration": null
}
],
"connections": [
{
"name": null,
"ports": [
{
"name": "PORT1"
},
{
"name": "IN"
}
]
},
{
"name": null,
"ports": [
{
"name": "PORT2"
},
{
"name": "OUT"
}
]
}
],
"goal": null,
"index": null,
"date_configured": null,
"date_measured": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
- **name**: None
- **components**:
-
- **name**: load_82052D
- **ports**:
-
- **name**: IN
- **domain**: None
- **connector**: SMA_3.5mm
- **manifold**: 82052D
- **connections**: None
- **components**:
- **environment**: None
- **manufacturer**: Agilent
-
- **name**: E8364A
- **ports**:
-
- **name**: PORT1
- **domain**: RF
- **connector**: None
- **manifold**: None
-
- **name**: PORT2
- **domain**: RF
- **connector**: None
- **manifold**: None
- **connections**: None
- **components**:
- **environment**: None
- **manufacturer**: Agilent
- **configuration**: None
- **connections**:
-
- **name**: None
- **ports**:
-
- **name**: PORT1
-
- **name**: IN
- **goal**: None
- **index**: None
- **date_configured**: None
- **date_measured**: None
Loading

0 comments on commit 03f3fc3

Please sign in to comment.