Update non_linear_analysis.md
This commit is contained in:
parent
3f69fa72d4
commit
17d857c2af
|
|
@ -1,33 +1,44 @@
|
|||
# Non-Linear Simulation
|
||||
|
||||
At this stage, we extend our simulations into the non-linear domain, as linearity is a critical factor in power amplifier design. To assess this, we need to determine the **P1dB compression point**, which indicates when the amplifier starts deviating from linear operation. Additionally, we will perform a **load-pull analysis** to optimize the output match for high linearity.
|
||||
In this section, we extend our simulations into the **non-linear domain**—an essential step in power amplifier design. Non-linearity plays a critical role in determining the performance of amplifiers under high signal conditions. Specifically, we aim to determine the **P1dB compression point**, which indicates when the amplifier begins to exhibit non-linear behavior. Additionally, we will perform a **load-pull analysis** to optimize the output matching for high linearity.
|
||||
|
||||
For non-linear simulations, **Ngspice** is no longer sufficient, as it does not support **harmonic balance analysis**, which is essential for capturing the non-linear behavior of RF circuits. Instead, we use **Xyce**, which provides the necessary non-linear simulation capabilities. However, Xyce lacks robust internal match calculations and graphing tools, making post-processing necessary. To overcome this, all data analysis and visualization will be handled through **Python scripts**, which process simulation results on the fly. The required scripts are available in the repository and should work seamlessly if schematic labels and naming conventions are followed consistently.
|
||||
## Transition to Non-Linear Simulations
|
||||
|
||||
Since non-linear simulations often require **input power sweeps**, but Xyce does not directly support this functionality, we will implement a workaround using a **sinusoidal current source** in combination with a fixed load resistance to vary the power level
|
||||
For linear simulations, **Ngspice** is typically sufficient. However, for non-linear simulations—necessary for RF circuit design—**Ngspice** does not support **harmonic balance analysis**, which is required to accurately capture the non-linear behavior of RF circuits. To address this, we will use **Xyce**, which provides the necessary non-linear simulation capabilities.
|
||||
|
||||
### Setting Up the First Testbench
|
||||
While Xyce handles non-linear simulations, it lacks internal calculations and graphing tools. As a result, post-processing is required for analysis and visualization. All post-processing tasks will be handled through **Python scripts**, which are available in this repository and are designed to work seamlessly, provided that the schematic labels and naming conventions are followed consistently.
|
||||
|
||||
In this context, we also need to implement a workaround for **input power sweeps**. Xyce does not directly support this functionality, so we will use a **sinusoidal current source** in combination with a fixed load resistance to vary the power level. The current issue is that the power source input power parameter cannot be swept directly. One workaround would be to run Xyce from the terminal and script the sweep externally. However, this approach has not been adopted here, as we aim to maximize interaction with Qucs-S.
|
||||
|
||||
---
|
||||
|
||||
## Setting Up the First Testbench
|
||||
|
||||
We begin by modifying the previous schematic to accommodate non-linear simulation. Since we are now using **Xyce models**, we need to specify a different library file for the **HBT transistors**. The correct path to the model library is:
|
||||
|
||||
For the first testbench, we continue from the previous schematic and modify it for non-linear simulation. Since we are now using Xyce models, we must specify a different library file for the HBT transistors. The correct path to the model library is:
|
||||
|
||||
```
|
||||
/../../IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerHBT.lib
|
||||
/insert/your/path/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerHBT.lib
|
||||
```
|
||||
|
||||
Additionally, we need to instantiate two key components:
|
||||
We also need to instantiate two key components for the non-linear simulation:
|
||||
|
||||
1. **Harmonic Balance Analysis Block** – Required for frequency-domain simulation of non-linear behavior.
|
||||
2. **Parameter Sweep Block** – Used to step through different operating conditions, such as varying input power.
|
||||
1. **Harmonic Balance Analysis Block** – This block is essential for frequency-domain simulation of the non-linear behavior.
|
||||
2. **Parameter Sweep Block** – This block is used to step through different operating conditions, such as varying input power.
|
||||
|
||||
The setup for these components is illustrated in the image below:
|
||||
The setup for these components is shown below:
|
||||
|
||||
<p align="center"> <img src="../../../media/module_2/harm_balance_1.png" width="300" height="200" /> </p>
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/harm_balance_1.png" width="300" height="250" />
|
||||
</p>
|
||||
|
||||
### Configuring the Parameter Sweep and Harmonic Balance
|
||||
---
|
||||
|
||||
_(Note: The Harmonic Balance block is only visible when the Xyce simulator is enabled.)_
|
||||
## Configuring the Parameter Sweep and Harmonic Balance
|
||||
|
||||
As shown in the image above, the **parameter sweep** is configured as follows:
|
||||
_(Note: The Harmonic Balance block is visible only when the Xyce simulator is enabled.)_
|
||||
|
||||
As shown in the schematic above, the **parameter sweep** is configured as follows:
|
||||
|
||||
```
|
||||
SW1
|
||||
|
|
@ -38,81 +49,102 @@ Start=0.0001
|
|||
Stop=0.05
|
||||
Points=51
|
||||
```
|
||||
_(make sure that the step size is a n natural number)_
|
||||
This setup defines a **linear sweep** for the parameter **y**, ranging from **0.0001 to 0.05** with **200 points**. This will allow us to analyze how the amplifier responds over a range of input conditions.
|
||||
_(Ensure that the step size is a natural number)_
|
||||
|
||||
For the **Harmonic Balance** analysis, the key parameter **n** is set to:
|
||||
This setup defines a **linear sweep** for the parameter **y**, ranging from **0.0001 to 0.05**, with **51 points**. This sweep will allow us to analyze how the amplifier responds to different input conditions.
|
||||
|
||||
$$n=5n$$
|
||||
For the **Harmonic Balance** analysis, we set the key parameter **n** to:
|
||||
|
||||
$$n=5$$
|
||||
|
||||
The complete schematic setup for the non-linear analysis, including all relevant components, is shown in the image below:
|
||||
Below is the complete schematic setup for the non-linear analysis, including all relevant components:
|
||||
|
||||
<p align="center"> <img src="../../../media/module_2/harm_balance_2.png" width="600" height="500" /> </p>
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/harm_balance_2.png" width="600" height="500" />
|
||||
</p>
|
||||
|
||||
_(Remember to set the frequency of sources and components accordingly.)_
|
||||
_(Remember to adjust the frequency of sources and components accordingly.)_
|
||||
|
||||
In this setup, we define a **parameter** named **y** with a default value. This parameter is essential for performing the input power sweep, but the value of y specified in the param section is unimportant in this case.
|
||||
In this setup, we define a **parameter** named **y** with a default value. This parameter is crucial for performing the input power sweep, but the value of **y** specified in the **param** section is unimportant for this specific setup.
|
||||
|
||||
As seen in the sweep configuration, we vary the **input current** from **0.0001 A to 0.05 A** through a **constant 50Ω resistor**. This corresponds to an **input power range of -33 dBm to 21 dBm**.
|
||||
|
||||
This sweep is crucial for evaluating the amplifier's behavior in the **non-linear region**, allowing us to determine its **1 dB compression point (P1dB)**—a key metric for assessing linearity.
|
||||
This sweep is essential for evaluating the amplifier’s behavior in the **non-linear region**, enabling us to determine its **1 dB compression point (P1dB)**, a key metric for assessing linearity.
|
||||
|
||||
---
|
||||
|
||||
### Running the Simulation and Verifying Results
|
||||
## Running the Simulation and Verifying Results
|
||||
|
||||
At this stage, we can proceed with running the simulation. Once the simulation is complete, the first step is to **instantiate a table** to inspect the results and ensure that the output data is correctly formatted.
|
||||
After setting up the simulation, we can run it and check the results. Upon completion, the first task is to **instantiate a table** to inspect the output data and ensure proper formatting.
|
||||
|
||||
In the table, we should observe **10 data points** for each swept parameter, corresponding to the **harmonic components**, both **positive and negative**. This confirms that the simulation is correctly capturing the harmonic balance response.
|
||||
In the table, we should observe **10 data points** for each swept parameter, corresponding to the **harmonic components** (both **positive and negative**). This confirms that the simulation has correctly captured the harmonic balance response.
|
||||
|
||||
The expected table output is shown below:
|
||||
|
||||
<p align="center"> <img src="../../../media/module_2/harm_balance_3.png" width="350" height="400" /> </p>
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/harm_balance_3.png" width="350" height="400" />
|
||||
</p>
|
||||
|
||||
### Processing the Simulation Data
|
||||
---
|
||||
|
||||
As seen in the results table, the simulation has run successfully. This confirms that the **sweeping parameter**, **frequency axis**, and **raw data** are correctly recorded.
|
||||
## Processing the Simulation Data
|
||||
|
||||
Within the **part_3_non_linear_analysis** section, a folder named **python** contains a jupyter lab script designed to facilitate post-processing. This script aims to provide an easy way to **plot gain vs. input power** and **output power vs. input power**. In order to use this extract the I/O current and voltages. This should be done by instantiating a cartesian plot founder under diagrams:
|
||||
<p align="center"> <img src="../../../media/module_2/diagram_main_dock.png" width="350" height="550" /> </p>
|
||||
After running the simulation, we can confirm that the sweeping parameter, frequency axis, and raw data are correctly recorded.
|
||||
|
||||
Within the **part_3_non_linear_analysis** folder, a **python** folder contains a **Jupyter Lab script** designed to facilitate post-processing. This script simplifies tasks like plotting **gain vs. input power** and **output power vs. input power**.
|
||||
|
||||
and plot the I/O current and voltages. This is done by double clicking the plot and selecting the appropriate data.
|
||||
To use the script, you will need to extract the **I/O current** and **voltages** by instantiating a **Cartesian plot** under the diagrams section:
|
||||
|
||||
<p align="center"> <img src="../../../media/module_2/edit_diagram_properties.png" width="400" height="450" /> </p>
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/diagram_main_dock.png" width="350" height="550" />
|
||||
</p>
|
||||
|
||||
To plot the I/O current and voltages, simply double-click the plot and select the appropriate data:
|
||||
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/edit_diagram_properties.png" width="500" height="450" />
|
||||
</p>
|
||||
|
||||
The extracted data should be in the following format (note the selection of arrows in the style) :
|
||||
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/arrow_cartesian_plot.png" width="600" height="400" />
|
||||
</p>
|
||||
|
||||
After obtaining the data, navigate to the **Jupyter Lab** script, ensuring that the data is properly pointed to as shown below:
|
||||
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/jupyter_lab_setup.png" width="600" height="400" />
|
||||
</p>
|
||||
Using the script you will optain plots like seen in the last image in the following markdown file.
|
||||
**Note:** There may be potential issues with the script, and you might need to adjust it based on the specific data format or cases encountered.
|
||||
|
||||
---
|
||||
|
||||
## Performing Load Pull
|
||||
|
||||
As observed in the previous simulation using ideal output components, the **1 dB compression point** was approximately **-7.88 dBm**. To optimize the output network, we aim to maximize the circuit's **linearity**. However, since sweeping a **complex impedance** (i.e., a±bia \pm bia±bi) is not straightforward, we instead perform a **resistive sweep** at the output and determine which resistance yields the best linearity.
|
||||
The goal of the load-pull analysis is to optimize the **output network** for maximum **linearity**. Since sweeping a **complex impedance** (i.e., a ±b𝑖) can be challenging, we use a **resistive sweep** at the output to find the best resistance for maximizing linearity. Additionally, it is possible to add a parallel capacitor or inductor to adjust the imaginary part of the impedance at a given resistance.
|
||||
|
||||
While this approach requires some manual adjustments, the **Python script** can assist in processing the results. The exact method is left to the user’s preference. In the following example, we analyze the compression point around a **50Ω termination** and identify the most suitable resistance.
|
||||
While this approach requires some manual adjustments, a **Python script** can assist in processing the results. The exact method is up to the user’s preference. Below, we focus on identifying the **compression point** around a **50Ω termination**, but similar steps can be followed for other resistances.
|
||||
|
||||
It is important to avoid **excessively low resistance values**, as this would degrade the amplifier’s characteristics significantly. Below, the schematic illustrates the setup for a **40Ω termination**:
|
||||
<p align="center"> <img src="../../../media/module_2/harm_balance_4.png" width="600" height="400" /> </p>
|
||||
It is important to avoid **excessively low resistance values**, as these will degrade the amplifier’s performance. Below is the schematic showing the setup for a **40Ω termination**:
|
||||
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/harm_balance_4.png" width="600" height="400" />
|
||||
</p>
|
||||
|
||||
Gain curve and compression point was seen as the following:
|
||||
<p align="center"> <img src="../../../media/module_2/gain_vs_input_power_2.png" width="600" height="500" /> </p>
|
||||
### Recommended Approach
|
||||
|
||||
1. Assume no influence on input reflection during the matching process.
|
||||
2. **Gradually tune** the network components to achieve the highest possible **P1dB** while maintaining a good match.
|
||||
|
||||
### Evaluating the Compression Point Shift
|
||||
The schematic below shows the configuration used for further analysis, and the corresponding **gain response** is depicted in the final image:
|
||||
|
||||
As observed, adjusting the termination has **moved the compression point upward**.
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/harm_balance_5.png" width="600" height="400" />
|
||||
</p>
|
||||
|
||||
#### **Implications for the Termination Network**
|
||||
<p align="center">
|
||||
<img src="../../../media/module_2/compression_point_plot.png" width="600" height="600" />
|
||||
</p>
|
||||
|
||||
This result suggests that **matching to a 40Ω termination improves the circuit’s linearity**. However, modifying the output match inevitably **affects the input match** and alters the **reflection coefficients**. This presents a trade-off, and it is left to the reader to determine an optimal matching network.
|
||||
|
||||
#### **Recommended Approach**
|
||||
|
||||
- Do a matching assuming no influence on input reflection.
|
||||
- **Gradually tune** the network components to achieve the highest possible **P1dB** while maintaining a good match.
|
||||
|
||||
The schematic below illustrates the circuit configuration that will be used in further analysis. The corresponding **gain response** is shown in the final image.
|
||||
<p align="center"> <img src="../../../media/module_2/harm_balance_5.png" width="600" height="400" /> </p>
|
||||
|
||||
![[harm_balance_5.png]]
|
||||
<p align="center"> <img src="../../../media/module_2/gain_vs_input_power_3.png" width="600" height="500" /> </p>
|
||||
|
||||
![[gain_vs_input_power_3.png]]
|
||||
|
|
|
|||
Loading…
Reference in New Issue