Simulate Your Circuits Using Qucs

0
395

In this article we explore the features and functions of Quite Universal Circuit Simulator (Qucs) and go through a step-by-step analysis. Qucs is available for Windows, Mac and Ubuntu (open source).

Abhishek A. Mutha


An open source electronics circuit simulator software released under GPL, Quite Universal Circuit Simulator (Qucs) provides the user with capabilities to set up a circuit with a graphical user interface. It can simulate circuit behaviour, and supports pure digital simulations using VHDL and/or Verilog languages.

Qucs is much simpler to use and handle than other circuit simulators like gEDA or PSpice. It also supports a growing list of analogue and digital components as well as Spice sub-circuits, which makes it easier to work with.

What is Qucs all about
Qucs is an integrated circuit simulator that enables you to set up a circuit with its intuitive graphical user interface (GUI) and simulate the small-signal, large-signal and noise behaviour of the circuit. Post simulation, you can view the simulation results on a presentation page or window.

Explore Circuits and Projects Explore Videos and Tutorials

Qucsator and GUI

The GUI is based on Qt by Digia. The software aims to support most kinds of circuit simulation like DC, AC, S-parameter, harmonic balance analysis and noise analysis to name a few. The Qucs GUI is well advanced and allows setting up schematics and presenting simulation results in various types of diagrams. Apart from representation in DC, AC, S-parameter, noise and transient analysis, mathematical equations and use of a sub-circuit hierarchy (with parameterised sub-circuits) are also available. Qucs can also import existing Spice models for use in your simulations.

Qucsator, the simulation back-end, is a command-line circuit simulator. It takes a network list in a certain format as input and outputs a Qucs dataset. It has been programmed for usage in the Qucs project but may also be used by other applications.

5C1_Fig-1
Fig. 1: Combined schematic and data visualisation
99C_Fig-2
Fig. 2: Data display with 3D diagram
8AE_Fig-3
Fig. 3: Data display with different kinds of data representations (diagrams) and data markers
CAE_Fig-4
Fig. 4: Qucs has been started

Qucs comes with a huge array of components and models including HICUM, BSIM2, BSIM3 and BSIM6 to list a few. It also provides semiconductor-based components and models such as PMOSFETs, MOSFETs, op-amps, diodes and many more.

While some examples have been included in this story to demonstrate some of the abilities of Qucs, many more are available within the program in the DVD.

Features and their functions

1F3_Fig-5
Fig. 5: Application Setting Dialog Box

Qucs consists of several stand-alone programs interacting with each other through the GUI, such as:

GUI. It is used to create schematics, set up simulations, display simulation results and to write VHDL code.

Back-end analogue simulator. The analogue simulator is a command line program which is run by the GUI in order to simulate the schematic that you previously setup. It takes a netlist, checks it for errors, performs the required simulation actions and finally produces a dataset.

Fig. 6: New Project Dialog
Fig. 6: New Project Dialog

Simple text editor. This is used to display netlists and simulation logging information, and also to edit files included by certain components (like Spice netlists or Touchstone files).

READ
Make FPGA Based Wonders With Papilio Boards

Filter synthesis application. The program can be used to design various types of filters.

Transmission line calculator. This can be used to design and analyse different types of transmission lines (examples: micro-strips, coaxial cables).

Component library. The component library manager holds models for real-life devices, such as transistors, diodes, bridges and op-amps. The user can extend it with additional components.

Attenuator synthesis application. The program can be used to design various types of passive attenuators.

FZC_Fig-7
Fig. 7: New empty project has been created
7FA_Fig-8
Fig. 8: Components tab

D85_AdditionalCommand line conversion program. The conversion tool is used by the GUI to import and export datasets, netlists and schematics from and to other CAD/EDA software. The supported file formats as well as usage information can be found on the home page of Qucs.

Additionally, the GUI steers other EDA tools. For digital simulations (via VHDL) the program FreeHDL (see http://www.freehdl.seul.org) is used. And for circuit optimisations ASCO (see http://asco.sourceforge.net) is configured and run.

Getting started
Once the software has been successfully installed on your system you can start it by issuing the # qucs command, or by clicking the appropriate icon on your start menu or desktop. Qucs is a multi-lingual program. Therefore, depending on your system’s language settings, the Qucs GUI appears in different languages.

On the left hand side you will find the Projects folder opened, as shown in Fig. 1. Usually, the projects folder will be empty if you are using Qucs for the first time. The large area on the right hand side is the schematic area. Right above it you can find the menu bar and the toolbars. Go to File → Application Settings menu to configure the language and appearance of Qucs.

For the language and font settings to take effect, the application (as seen in Fig. 2) must be closed either via the Ctrl + Q shortcut or the File → Exit menu entry. Then re-start Qucs.

Setting up schematics
The following sections will enable the user to set up some simple schematics. For this, first create a new project named ‘WorkBook.’ Either press the New button above the projects folder or use the menu entry Project → New Project, and enter the new project name as shown in Fig. 3.

Confirm the dialogue by pressing the Create button. When done, the project is opened and Qucs switches to the Content tab.

C47_Fig-9
Fig. 9: Components of the voltage divider appropriately wired
79Z_Fig-10
Fig. 10: Ground symbol as well as DC simulation in place
497_Fig-11
Fig. 11: Final voltage divider schematic
DCZ_Fig-12
Fig. 12: Data display with tabular graph
17D_Fig-13
Fig. 13: Simple filter in qucs-qt4
8BE_Fig-14
Fig. 14: Simple schematic area

In the Content tab, as seen in Fig. 4, you will find all the data related to the project. It contains your schematics, the VHDL files, data display pages, datasets as well as any other data (like datasheets). On the right hand side, an untitled and empty schematic window is displayed. Now you can start to edit the schematic. The available components can be found in the Components tab.

READ
RFID Testing Challenges For Complex RF Environments

The window in Fig. 5 is displayed on clicking the Components tab. There are lumped components (such as resistors and capacitors), sources (such as DC and AC sources), transmission lines (like microstrip, coaxial cable, twisted pair), nonlinear components (like ideal op-amp, transistors), digital components (like flip-flops), file components (like Touchstone files, Spice files), simulations (AC or DC analysis), diagrams (like Cartesian or polar plot) and paintings (such as texts, arrows, circles).

Each of the components can be placed on the schematic by clicking it once. Then move the cursor onto the schematic and click again to put it on its final position. You can right click to rotate the component into its final position. You can even drag-and-drop the components.

DC simulation of a voltage divider
DC analysis is a steady-state analysis. It computes the node voltage as well as branch currents of the complete circuit. The circuit in Fig. 6 is for dividing the voltage of a DC voltage source according to the resistor ratio.

Wiring components. Connect the components appropriately using the wiring tool. Enable the wiring mode either by clicking the wire icon or by pressing the Ctrl + E shortcut. Left clicking on the components’ ports (small red circles) starts a wire and clicking on a second port finishes the wire. In order to change the orientation of the wire, right click it. You can leave the wiring mode by pressing Esc key.

F37_Box-1F25_Box-2EF1_Box3

For any analogue simulation (including the DC simulation), there is a reference potential required (for the nodal analysis). The ground symbol can be found in the Components tab in the lumped components category. The user can also choose the ground symbol icon or simply press the Ctrl + G shortcut. In the circuit in Fig. 7, the ground symbol is placed at the negative terminal of the DC voltage source.

Placing simulation blocks. The type of simulation that is to be performed must also be placed on the schematic. You can do this by choosing the ‘DC simulation’ block, which is found in the Components tab in the simulations category.

Labelling wires. If you want voltage between the two resistors (the divided voltage) be output in the dataset after simulation, you need to label the wire. This is done by double clicking the wire and giving it an appropriate name. Wire labelling can also be done using the icon in the toolbar, by pressing the Ctrl + L shortcut or by choosing the Insert → Wire Label menu entry.

The dialogue is closed by pressing the Enter key or pressing the Ok button. Now the complete schematic for the voltage divider is ready and can be saved. This can by done by choosing the File → Save menu entry, clicking the Single Disk icon or by pressing the Ctrl + S shortcut.

READ
Testing Of Solar-Based Devices And Panels

The final DC voltage divider is shown in Fig. 8.

Issuing a simulation. The schematic can now be simulated. This is started by choosing the Simulation → Simulate menu entry, clicking the simulation button (the gearwheel) or by pressing the F2 shortcut. After the simulation has been done, the related data display is shown. Also, the Components tab changes its category to ‘diagrams.’

Placing diagrams. Choose the tabular (list of values) diagram and place it on the data display page. By double clicking ‘divided.V’, the graph (values in a tabular plot) is added to the diagram. Besides the node voltage ‘divided.V’ the current through the DC voltage source V1.I is available. Only items listed in the dataset list can be put into the graph.

Available dataset items
Depending on the type of simulation the user performed you find the following types of items in the dataset:

 

# node.V – DC voltage at node node
# name.I – DC current through
component name
# node.v – AC voltage at node node
# name.i – AC current through
component name
# node.vn – AC noise voltage at node
node
# name.in – AC noise current through
component name
# node.Vt – Transient voltage at node
node
# name.It – Transient current through
component name
# S[1,1] – S-parameter value

Please note that all voltages and currents are peak values and all noise voltages are RMS values at 1Hz bandwidth.

Depending on the type of graph, you have various options to choose for the graph. For a tabular graph, there is the number precision as well as type of number notation (important for complex values). Press the Ok button to close the dialogue.

In the tabular graph, as seen in , the value of the node voltage ‘divided.V’ is 0.5V. That is expected since the resistors are of equal values and the DC voltage source produces 1V.

Congratulations! You made your first successful simulation using Qucs.

License
Qucs is a free software released under the General Public License (GPL). It comes with complete source code. Every user of the program is allowed and called upon (on a voluntary basis of course) to modify it for their applications, as long as the changes are made public.

The screenshots show the main schematic and data display area of the Qucs GUI on the lower right corner, the menus and icons at the upper part and the project/contents/component/action/diagram selection on the left-hand side.

Download Latest version: click here


The author is a senior technical correspondent at EFY. This article has inputs from Qucs’ recently released documentation

LEAVE A REPLY