Microstrip Line Design - simple#
This tutorial tells you how to design a simple microstrip transmission line with simpleEMS.
Note
You must have simpleEMS and openEMS on your computer. See Installation.
Make a file with the name microstrip_line.py.
Import the modules#
Import MicrostripLineParams, MicrostripLine, and setup_simulation from
simpleEMS.
from simpleEMS import (
MicrostripLine,
MicrostripLineParams,
setup_simulation,
)
MicrostripLineParams holds the parameters of the line and of the simulation.
MicrostripLine makes the line.
setup_simulation makes the CSXCAD geometry and the FDTD solver. It also sets
the frequency range of the simulation.
Set the parameters#
params = MicrostripLineParams(
min_freq=1e9,
max_freq=2e9,
target_freq=1.7e9,
substrate_thickness_mm=1.6,
substrate_eps_r=4.4,
substrate_tand=0.001,
charac_imp=50,
)
MicrostripLineParams holds the target frequency, the properties of the
substrate, and the characteristic impedance of the line.
Set up the simulation#
sim = setup_simulation(params)
setup_simulation prepares the FDTD solver and the CSXCAD geometry. It returns
a SimSetup with the CSX, FDTD, and freqs attributes.
Build the line#
microstrip = MicrostripLine(params, sim)
microstrip.print_and_save_params(params)
ports = microstrip.build_microstrip_line()
microstrip.create_mesh()
microstrip.add_field_dump(sim, params)
microstrip.write_and_show_structure(sim)
These commands build the substrate, the ground plane, the trace, the ports, and the mesh. Then they show the structure in AppCSXCAD. Close the AppCSXCAD window to continue. The line is now ready for the simulation.
Run the simulation#
microstrip.run_simulation(sim)
This command runs the openEMS solver. Wait until the solver stops.
Show the results#
sim_data = microstrip.compute_sim_data(sim, ports)
microstrip.plot_s_param(sim_data.freqs, sim_data.s11, sim_data.s21)
microstrip.plot_impedance(sim_data.freqs, sim_data.z11)
microstrip.plot_phase(sim_data.freqs, sim_data.s21)
microstrip.plot_group_delay(sim_data.freqs, sim_data.s21)
microstrip.show_plots()
These commands show the S11 and the S21 curves, the complex impedance, the phase, and the group delay. A good line has a low S11 and a group delay that stays constant with frequency.
Complete script#
The complete script is below. It designs the line, runs the simulation, and shows the results.
#!/usr/bin/env python3
"""Microstrip transmission line design example at 1.7 GHz."""
# IMPORTS
from simpleEMS import (
MicrostripLine,
MicrostripLineParams,
setup_simulation,
)
# IMPORTS
# PARAMS
params = MicrostripLineParams(
min_freq=1e9,
max_freq=2e9,
target_freq=1.7e9,
substrate_thickness_mm=1.6,
substrate_eps_r=4.4,
substrate_tand=0.001,
charac_imp=50,
)
# PARAMS
# SETUP
sim = setup_simulation(params)
# SETUP
# BUILD
microstrip = MicrostripLine(params, sim)
microstrip.print_and_save_params(params)
ports = microstrip.build_microstrip_line()
microstrip.create_mesh()
microstrip.add_field_dump(sim, params)
microstrip.write_and_show_structure(sim)
# BUILD
# SIMULATE
microstrip.run_simulation(sim)
# SIMULATE
# PPROCESS
sim_data = microstrip.compute_sim_data(sim, ports)
microstrip.plot_s_param(sim_data.freqs, sim_data.s11, sim_data.s21)
microstrip.plot_impedance(sim_data.freqs, sim_data.z11)
microstrip.plot_phase(sim_data.freqs, sim_data.s21)
microstrip.plot_group_delay(sim_data.freqs, sim_data.s21)
microstrip.show_plots()
# PPROCESS