Skip to content

Commit

Permalink
more components
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Jul 28, 2024
1 parent 836e99f commit cf09060
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
#
# A very common package to model radio-frequency systems in python is called [`scikit-rf`](https://scikit-rf.readthedocs.io/en/latest/index.html). Particularly, it has a lot of useful functionality to translate IO files directly from common measurement standards in a format that is useful for device characterization and modelling. We will explore some basic situations commonly used throughout modelling `rf-photonic` systems.
#
# As far as I can tell from basic usage, the only useful files are one-port `.s1p` and two-port`.s2p` Touchstone files for trace measurments, and `.cti` files for calibration/instrument settings storage. We will use `.s2p` files throughout primarily.
# As far as I can tell from basic usage, the only useful files are one-port `.s1p` and two-port`.s2p` Touchstone files for trace measurements, and `.cti` files for calibration/instrument settings storage. We will use `.s2p` files throughout primarily.

import skrf
from skrf.io.touchstone import hfss_touchstone_2_network
Expand All @@ -157,7 +157,7 @@

# A very common procedure when doing a measurement with a vector-network-analyser (VNA) is to perform calibration, also called de-embedding. This is to move the measurement plane from the VNA up to the device-under-test (DUT) and is necessary for accurate measurements of our devices.
#
# There are multiple ways to implement de-embedding or calibration in practice. Most VNAs will have some protocol encoded in their internal firmware/software to implement this. Other ways to do this are using software packages such as `scikit-rf`. Let's set up a measurement experiement to understand the accuracy of either implmenetation.
# There are multiple ways to implement de-embedding or calibration in practice. Most VNAs will have some protocol encoded in their internal firmware/software to implement this. Other ways to do this are using software packages such as `scikit-rf`. Let's set up a measurement experiment to understand the accuracy of either implementation.
#
# Alongside the equipment calibration manual, some good references about this are:
#
Expand All @@ -172,6 +172,7 @@
#
# 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


# ## Frequency-Domain Analysis
Expand Down Expand Up @@ -235,7 +236,7 @@

# #### Identifying bad/shifting calibration

# We identfied we had another damaged calibration kit due to the way the refrence plots were generated.
# We identified we had another damaged calibration kit due to the way the reference plots were generated.
#
# <figure>
# <img src="../../_static/img/examples/08_basic_interconnection_modelling/experimental_bad_cal_terminator.jpg" alt="drawing" width="70%"/>
Expand All @@ -254,7 +255,7 @@

# #### Why inverse-matrix-multipling measurement extraction does not work practically?
#
# There are cases in which we might want to de-embed a measurement from another measurement. This has to do with moving the refrence planes between two measurements. Say, with a given calibration, we perform a through measurement of two cables and another through measurements of three cables, two which were the first measurement. It would be nice if we could determine the performance of the third new cable in the two cable network without having to recalibrate to the two-original-cables reference plane. This is the type of sitaution this comes handy.
# There are cases in which we might want to de-embed a measurement from another measurement. This has to do with moving the reference planes between two measurements. Say, with a given calibration, we perform a through measurement of two cables and another through measurements of three cables, two which were the first measurement. It would be nice if we could determine the performance of the third new cable in the two cable network without having to recalibrate to the two-original-cables reference plane. This is the type of situation this comes handy.
#
# This is not exactly "de-embedding" in the hardware-sense of the work, but maybe means more towards software network extraction from measurements.
#
Expand Down Expand Up @@ -454,10 +455,6 @@ def construct_calibration_networks(
load_ideal_2p,
thru_ideal, # Thru should be the last
]
open_ideal_2p,
load_ideal_2p,
thru_ideal, # Thru should be the last
]

# a list of Network types, holding 'measured' responses
my_measured = [
Expand Down Expand Up @@ -521,7 +518,7 @@ def construct_calibration_networks(

# ### Measurement Verification of a Coaxial-Cable

# A coaxial cable is a transmission line, which means it has a signal transmission associated with it for a range of RF frequencies. We might want to explore how the attentuation and reflection of our high-frequency signals operate. Let's understand some network theory basics in relation to an actual experimental context.
# A coaxial cable is a transmission line, which means it has a signal transmission associated with it for a range of RF frequencies. We might want to explore how the attenuation and reflection of our high-frequency signals operate. Let's understand some network theory basics in relation to an actual experimental context.
#
# In this example, we will consider the experimental PNA network measurement of a [141-1MSM+](https://www.minicircuits.com/WebStore/dashboard.html?model=141-1MSM%2B) cable and compare it to some network theory.
#
Expand Down
1 change: 0 additions & 1 deletion piel/experimental/AWG70001A/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions piel/experimental/AWG70001A/core.py

This file was deleted.

2 changes: 1 addition & 1 deletion piel/experimental/DPO73304/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class DPO73304(Oscilloscope):
name = "DPO73304"
name: str = "DPO73304"
1 change: 0 additions & 1 deletion piel/experimental/E8364A/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions piel/experimental/E8364A/core.py

This file was deleted.

6 changes: 0 additions & 6 deletions piel/experimental/SMA82052D/__init__.py

This file was deleted.

46 changes: 0 additions & 46 deletions piel/experimental/SMA82052D/core.py

This file was deleted.

10 changes: 7 additions & 3 deletions piel/experimental/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import piel.experimental.types as types
import piel.experimental.visual as visual

from . import E8364A
from . import DPO73304
from . import AWG70001A
from . import SMA82052D

from .file_system import (
construct_experiment_directories,
construct_experiment_structure,
)

from .models.cables import rg164
from .models.oscilloscope import create_two_port_oscilloscope
from .models.waveform_generator import create_one_port_square_wave_waveform_generator
from .models.rf_passives import create_power_splitter_1to2
from .models.rf_calibration import (
open_82052D,
short_82052D,
load_85052D,
through_85052D,
)
20 changes: 20 additions & 0 deletions piel/experimental/models/cables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from ...types import CoaxialCable, CoaxialCableGeometryType


def rg164(
length_m: float,
) -> CoaxialCable:
geometry = CoaxialCableGeometryType(
length_m=length_m,
)

return CoaxialCable(name="RG164", geometry=geometry)


def cryo_cable(
length_m: float,
) -> CoaxialCable:
# TODO measure them
geometry = CoaxialCableGeometryType(length_m=length_m)

return CoaxialCable(geometry=geometry)
6 changes: 5 additions & 1 deletion piel/experimental/models/oscilloscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ..types import Oscilloscope


def create_two_port_oscilloscope():
def create_two_port_oscilloscope() -> Oscilloscope:
ports = [
PhysicalPort(
name="CH1",
Expand All @@ -20,3 +20,7 @@ def create_two_port_oscilloscope():
name="two_port_oscilloscope",
ports=ports,
)


def create_DPO73304():
pass
17 changes: 17 additions & 0 deletions piel/experimental/models/rf_calibration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from piel.types import Short, Open, Load, Through


def short_82052D():
return Short(name="short_82052D")


def open_82052D():
return Open(name="open_82052D")


def load_85052D():
return Load(name="load_82052D")


def through_85052D():
return Through(name="through_82052D")
5 changes: 5 additions & 0 deletions piel/experimental/models/vna.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import piel.experimental as pe


def create_E8364A() -> pe.types.VNA:
pass
4 changes: 4 additions & 0 deletions piel/experimental/models/waveform_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ def create_one_port_square_wave_waveform_generator(
ports=ports,
configuration=configuration,
)


def create_AWG70001A() -> WaveformGenerator:
pass
4 changes: 4 additions & 0 deletions piel/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
DCCableGeometryType,
DCCableHeatTransferType,
DCCableMaterialSpecificationType,
DCCable,
CoaxialCable,
)

from .electrical.pcb import PCB

from .electrical.rf_calibration import Short, Open, Load, Through

from .electrical.rf_passives import (
PowerSplitter,
)
Expand Down
20 changes: 20 additions & 0 deletions piel/types/electrical/rf_calibration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from ...types import PhysicalComponent, PhysicalPort


class Short(PhysicalComponent):
ports = [PhysicalPort(name="SHORT", connector="SMA_3.5mm", manifold="82052D")]


class Open(PhysicalComponent):
ports = [PhysicalPort(name="OPEN", connector="SMA_3.5mm", manifold="82052D")]


class Load(PhysicalComponent):
ports = [PhysicalPort(name="LOAD", connector="SMA_3.5mm", manifold="82052D")]


class Through(PhysicalComponent):
ports = [
PhysicalPort(name="IN", connector="SMA_3.5mm", manifold="82052D"),
PhysicalPort(name="OUT", connector="SMA_3.5mm", manifold="82052D"),
]

0 comments on commit cf09060

Please sign in to comment.