Inset Fed Patch Antenna Design - simple#

This tutorial tells you how to design a simple inset-fed patch antenna with simpleEMS.

Note

You must have simpleEMS and openEMS on your computer. See Installation.

Make a file with the name inset_fed_patch_antenna.py.

Import the modules#

Import InsetFedPatchParams, InsetFedPatchAntenna, and setup_simulation from simpleEMS.

from simpleEMS import (
    InsetFedPatchAntenna,
    InsetFedPatchParams,
    setup_simulation,
)

InsetFedPatchParams holds the parameters of the antenna and of the simulation.

InsetFedPatchAntenna makes the antenna.

setup_simulation makes the CSXCAD geometry and the FDTD solver. It also sets the frequency range of the simulation.

Set the parameters#

params = InsetFedPatchParams(
    resonant_freq=2.45e9,
    span_freq=0.5e9,
    substrate_thickness_mm=1.6,
    substrate_eps_r=4.4,
    substrate_tand=0.001,
    charac_imp=50,
)

InsetFedPatchParams holds the resonant frequency, the properties of the substrate, and the characteristic impedance of the antenna.

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 antenna#

patch = InsetFedPatchAntenna(params, sim)
patch.print_and_save_params(params)
port = patch.build_inset_fed_patch_antenna()
patch.create_mesh()
nf2ff = patch.create_nf2ff(sim)
patch.add_field_dump(sim, params)
patch.write_and_show_structure(sim)

These commands build the antenna. Then they show the structure in AppCSXCAD. Close the AppCSXCAD window to continue. The antenna is now ready for the simulation.

Run the simulation#

patch.run_simulation(sim)

This command runs the openEMS solver. Wait until the solver stops.

Show the results#

sim_data = patch.compute_sim_data(sim, port)
nf2ff_3d_result = patch.compute_nf2ff_3d(nf2ff, params.resonant_freq)
patch.plot_s_param(sim_data.freqs, sim_data.s11)
patch.plot_smith_chart(sim_data.freqs, sim_data.s11)
patch.plot_vswr(sim_data.freqs, sim_data.vswr)
patch.plot_impedance(sim_data.freqs, sim_data.z11)
patch.plot_2d_directivity(nf2ff, params.resonant_freq)
patch.plot_2d_rad_pattern(nf2ff, params.resonant_freq)
patch.plot_3d_directivity(nf2ff_3d_result, params.resonant_freq)
patch.plot_3d_gain(nf2ff_3d_result, params.resonant_freq, sim_data.input_power)
patch.plot_3d_power(nf2ff_3d_result, params.resonant_freq)
patch.save_plots()
patch.show_plots()

These commands show the S11 curve, the VSWR, and the complex impedance. They also show the radiation pattern and the directivity in 2D and in 3D.

Export the results#

You can write the model to different formats. Use these files in other tools, or send them to a PCB manufacturer.

patch.export_stl(sim)
patch.export_touchstone(
    sim_data.freqs,
    sim_data.s11,
    charac_imp=params.charac_imp,
)
patch.export_gerber(sim)

Complete script#

The complete script is below. It designs the antenna, runs the simulation, and shows the results.

#!/usr/bin/env python3
"""Simple inset-fed patch antenna example at 2.45 GHz."""

# IMPORTS
from simpleEMS import (
    InsetFedPatchAntenna,
    InsetFedPatchParams,
    setup_simulation,
)

# IMPORTS

# PARAMS
params = InsetFedPatchParams(
    resonant_freq=2.45e9,
    span_freq=0.5e9,
    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
patch = InsetFedPatchAntenna(params, sim)
patch.print_and_save_params(params)
port = patch.build_inset_fed_patch_antenna()
patch.create_mesh()
nf2ff = patch.create_nf2ff(sim)
patch.add_field_dump(sim, params)
patch.write_and_show_structure(sim)
# BUILD

# SIMULATE
patch.run_simulation(sim)
# SIMULATE

# PPROCESS
sim_data = patch.compute_sim_data(sim, port)
nf2ff_3d_result = patch.compute_nf2ff_3d(nf2ff, params.resonant_freq)
patch.plot_s_param(sim_data.freqs, sim_data.s11)
patch.plot_smith_chart(sim_data.freqs, sim_data.s11)
patch.plot_vswr(sim_data.freqs, sim_data.vswr)
patch.plot_impedance(sim_data.freqs, sim_data.z11)
patch.plot_2d_directivity(nf2ff, params.resonant_freq)
patch.plot_2d_rad_pattern(nf2ff, params.resonant_freq)
patch.plot_3d_directivity(nf2ff_3d_result, params.resonant_freq)
patch.plot_3d_gain(nf2ff_3d_result, params.resonant_freq, sim_data.input_power)
patch.plot_3d_power(nf2ff_3d_result, params.resonant_freq)
patch.save_plots()
patch.show_plots()
# PPROCESS

# EXPORT
patch.export_stl(sim)
patch.export_touchstone(
    sim_data.freqs,
    sim_data.s11,
    charac_imp=params.charac_imp,
)
patch.export_gerber(sim)
# EXPORT