Quick Solutions to Solve SPICE Convergence Issues.

This article focuses on PSPICE, but most of the parameters and their settings  are common to other SPICE versions like XSPICE NGSPICE IsSPICE HSPICE.

The SPICE simulation convergence issues mainly occur for 3 types of problems:

• Circuit Topology Errors

these types of errors are often signaled with precise messages from the SPICE simulation software and it is easy to identify and correct them.

• SPICE simulator Options Settings

for example, in the transient analysis, it ‘s necessary to consider the right timestep for the working frequency of the device, and in some cases we have to settle for moderate accuracy,  because tighter the accuracy become and more likely we can find convergence errors.

• Unrealistic SPICE models

convergence problems can arise from SPICE models with strong non-linearities and discontinuities.

Now let’s see what are the quick solutions to solve the most common convergence issues due to these different types of problems.

Circuit Topology Errors

Missing ground, error message: Node is floating.

The SPICE algorithm calculates the voltage of each point of the circuit with respect to a reference point,
this reference point is precisely the ground which must necessarily be present in the circuit.
It ‘s enough to add the ground reference wherever we wish.

Missing DC path to ground, error message: Node is floating.

For the reasons explained in the previous case, it is necessary to check that no point of the circuit is isolated
from the ground reference. If we want to “simulate” an isolation of a node from the ground, we do it placing a
very high value resistor, which actually maintains the continuity with the ground reference.
Check that the node has a direct connection with the ground reference.

Unmodeled pins, error message: Less than two connections at node

this error occurs when there is no PSpice model attached to the Capture part or when there’s a
wire “floating”, that is connected to a device pin without connection to another pin.

Avoid loops containing voltage sources or inductor, error message: voltage source or inductor loop

We can add a small series resistance.

Avoid series cpacitors o current sources

verify that there are no series capacitors or series current sources.

Convergence Problems due to SPICE Simulation options settings

First of all it is necessary to set the timestep appropriately for the device we are simulating. For example, if we want to simulate an oscillator at 1 khz, with a period of T=1ms, we ‘ll have to set a timestep of the order of T/10 or lower, to have a decent resolution of the simulation.
Let’ s distinguish the solutions that can be adopted in the two main types of analysis, DC and Transient.
Once DC convergence is achieved the AC analysis will also converge.

SPICE DC convergence solutions

ITL1: set ITL1=500, this set iterations limit that SPICE will perform for DC and bias.

ITL2: set ITL2=500, this set iterations limit that SPICE will perform for DC and bias before giving up.

ITL6: set ITL6=100 (Advanced Options), this increases Source stepping iteration limit, Default value
is 0, which disables source stepping.

reduce ABSTOL Absolute current tolerance, it should be set to about 8 orders of magnitude below the level of maximum current,
the dafault value is 1pA

Reduce VNTOL Absolute voltage tolerance, as for ABSTOL it should be set to about 8 orders of magnitude below the level of maximum voltage, the default value is 1uV

Reduce RELTOL this is the relative error allowed for node voltage and branch current. Set RELTOL= 0.01 to reach a compromise between accuracy and simulation run time. The default value is 0.001.

GMIN set GMIN = 1n or 0,1n. GMIN is the minimum conductance across all semiconductor devices

GMINSTEPS (Advanced Options) set GMINSTEPS=200 . this option adjusts the number of increments for GMIN
during the DC analysis.

Change DC Power supplies into Pulse generator

NODESETs use .NODESETs statement to assign a voltage to a node. This can be done for example when the node-voltage table shows unrealistic voltages. If it’s not available a proper estimation of the node DC voltage, use
a .NODESET of 0V.

SPICE Transient Convergence solutions

RELTOL also for the transient analysis Set RELTOL= 0.01 (The default value is 0.001), that decreases the accuracy
of the simulation by increasing the error tolerance required for convergence.

ITL4 set ITL4=2000 , this increases the number of iterations before a nonconvergence warning is issued

reduce ABSTOL Absolute current tolerance, it should be set to about 8 orders of magnitude below the level of maximum current, the dafault value is 1pA

Reduce VNTOL Absolute voltage tolerance, as for ABSTOL it should be set to about 8 orders of magnitude below the level of maximum voltage, the default value is 1uV

ITL5 set ITL5=0 that assigns infinity to the total transient iteration limit.

Reduce rise and fall of PULSE sources

GEAR (Advanced Options) Select METHOD=GEAR, this is the integration method that SPICE uses to solve transient equations. Very useful for oscillators and switching circuits SPICE simulations.

TRTOL set TRTOL=40. this is the tolerance for integration error calculated using transient analysis. The TRTOL
value should NOT be greater than 1/RELTOL. the default value is 7.

IC set Initial conditions for the capacitors at their expected operating voltage. Setting this data causes
SPICE to bypass the DC operating point analysis.

Use reliable SPICE models.

As we know The SPICE models do not coincide with the devices they model, but represent only a partial description of them. SPICE models with strong discontinuities or non-linearities can create serious convergence problems.
These discontinuities can originate from the omission of certain device behaviors, such as element parasitics,
capacitance for all semiconductor junctions, stray capacitance, RC snubbers around diodes.
In most cases we can rely on the SPICE models released by vendors, if instead we model the device directly, we have to smooth as much as possible any cause of discontinuities and nonlinearities.

Reference:

EMA Design Automation Resolving Simulation Errors
SPICE Circuit Handbook Steven. M Sandler Charles Hymowitz

Straightforward Method to Design and Simulate with SPICE the Loop Compensation Controller for All Switching Power Supplies.

Ing. Cristoforo Baldoni

In this article we ‘ll see how to find the output power stage transfer function H(s), called the Control-to-Output function,  of the most switching power supplies: BUCK, BOOST, BUCK-BOOST, HALF-BRIDGE, FULL BRIDGE, both in voltage mode control and current mode control. In spite of the complexity of the different types of power supplies that use one or more output feedback, the output power transfer function H(s), can be reduced to a few schematic categories of general validity. We’ ll see when it’s the case to consider the effects of the RHPZ, the Right Half Plane Zero, and what it means in practical terms.
Once the components for the specific power supply have been sized, we can estimate with good approximation the transfer function which describes mathematically the output power stage. As seen in the article about the determination of POLES and ZEROS by inspection,  we ‘ll identify immediately the POLES and ZEROS which characterize the different switching categories.
We ‘ll draw the Bode plots of these functions with PSpice, and, according to their characteristics, we ‘ll choose the most suitable compensator G(s), implementing the compensation network with the operational amplifiers embedded in the microcontrollers. The SPICE simulation of the open loop transfer function G(s)*H(s), will allows us to evaluate the results for the system stability. Finally, we ‘ll apply this method in two real switching power supply: a low power flyback converter and an off-line, half-bridge switching.
This method allows us to speed up the design of the compensator G(s) in the prototyping phase before the physical measurement with the instrumentation.

It’s strongly recommended the reading of these articles:

Accessing this article you can download the following SPICE simulation files about switching power supply compensation design:

-Forward function example

-Flyback function example

-Flyback function example with a Right Half Plane ZERO

-Origin POLE compensator

-Origin POLE Transfer function implementation

-Forward function compensated example

-One ZERO two POLES compensator

-One ZERO two POLES Transfer Function Implementation

-Flyback with RHPZ compensated

-Three POLES two ZEROS compensator

-Three POLES two ZEROS Transfer Function

-Transfer function of a real Flyback converter

-Compensator for the flyback converter

-Overall compensated  transfer function of the flyback converter

-Transfer function of a real Forward converter

-Compensator for the Forward converter

-Transfer function of compensator for the Forward converter

-Overall compensated  transfer function of the Forward converter

Designing Industrial PID Controllers using SPICE

1. Design of PID regulators , design and test with SPICE simulation

2. Easy way to implement compensators with operational amplifiers

1. Design of PID regulators , design and test with SPICE simulation

Graphical method

Let’s examine now a graphical method for designing P.I.D. controllers. P.I.D. are Proportional-Integral-Derivative controllers and represent one of the techniques widely used to implement industrial control systems. Below the diagram block of a typical feedback system

Figure 1 – Generic feedback system

There are several types of compensators, in series, in feedback and combinations of both. The compensator in series is the most used. A compensation system is required when the closed loop system is unstable, when the system is stable but the steady state error or the dynamic behavior doesn’t meet the required specifications, or both. To compensate the system we put before the process (in series) a controller whose transfer function is R(s), as you can see in the figure below

Figure 2 – Compensated feedback system

The generic transfer function introduced by the P.I.D. controller can be expressed as:

(0.1)

P.I.D. controllers can exist also as a simple P controller (KD = KI =0), as a P.D. controller (KI = 0), or as a P.I. controller (KD =0). The proportional contribute of a P controller can improve the specification about the steady state error, the derivative contribute increases the damping of the closed loop system and the integrative contribute increases the type of the system, and then can eliminate or improve the steady state error.

P CONTROLLER.

The simplest version is the proportional controller P. Its transfer function is:

(0.2)

This type of controller can improve the specification on the steady state error, but at the same time increases the bandwidth of the feedback system which means a faster response of the system to follow the reference but a decrease of the stability margins.  For a system with unitary feedback and open loop transfer function equal to F(s) the steady state error is:

(0.3)

multiplying by the gain Kp the new error will be

(0.4)

let’s see a practical example, the open loop transfer function of a unitary feedback system is

(0.5)

Figure 3 – Implementation of open loop function with Laplace PART in PSpice

The bode plot of the transfer function is:

Figure 4 – Bode plot of gain and phase

The specification on the system requires, for example, a steady state error equal to 3% and a phase margin PM of 50 degrees.It’s:

(0.6)

we have to impose

(0.7)

we get KP= 388.

Plotting the compensated function we get

Figure 5 – Bode plot of function compensated with proportional controller

The phase corresponding to the crossing frequency is about -156 degrees

Figure 6 – Phase at crossing frequency

the specific on the phase margin can’t be satisfied with only the proportional compensation.

Control System Theory and SPICE Simulation

Ing. Cristoforo Baldoni

This article provides the principles for the design and analysis of Feedback and Control Systems. The Control Systems are everywhere in the modern industrial technological world, in the laser positioning of a CD Reader,  in the very high precision positioning system of an hard disk head, and even our body has a large number of biological control systems. After introducing the basic concepts, we’ll see how easily evaluate the Open loop Transfer Function with PSPice.

Topics

1.  Processes, Open Loop and Closed Loop Control Systems (Feedback Systems)

2. Generic closed loop schematic of Feedback Systems

3. Physycal Processes Modeling, differential equations and calculations simplification with Laplace transform

4. Transfer Function, Poles and Zeros of a Transfer Function, phisical meaning

5. Natural and Forced Response, calculating Residues, when it’s possible simplify identical Zeros and Poles, dominant poles

6. Process Stability

7. Steady State Error, Type of Systems

8. Study of Transfer Function with Bode diagram. Study the Open Loop Transfer Function with SPICE.

Altium Designer Video tutorials

TopicVideo
Getting started with Altium Designer
What is a project in Altium Designer
Create a project and adding documents
How to create a schematic symbol in Altium Designer
How to wire a schematic in Altium Designer
Resolve ERC errors
How to create a PCB footprint in Altium Designer
Setting PCB footprints
keeping schematic and PCB synchronized in Altium Designer
How to place the components on the board
Routing the PCB
How to change the shape of PCB in Altium Designer
Layer stack and drill pairs

Getting Started with Altium Designer

In this article we are going to  draw a simple inverting op-amplifier with dual power supply to introduce the reader to the fundamental tools used in the Altium Designer suite.

Let’s begin creating a new schematic:

a new blank sheet pops up

on the top toolbar we find the icon to place part

The place part window appears

Click on the button “…” to open the Browse Libraries window

moving throughout the first list we can select a library

Once selected the library we can easily choose a library’s component

Getting Started with NI Multisim

For exploring some of the main features of this software we’  ll design an IC 20W power amplifier with a LM 1875T.

After running the program Multisim opens the default capture and simulation environment:

Now let’s select the components for our amplifier

The Component Browser dialog window appears, the components are organized into Groups and Families:

In the same Component Browser window, under the label “Components”, we can search a component editing its name, in this case LM1875T

Arduino Simulation with Proteus

We ‘ll show how to simulate the celebrated open-source electronics prototyping platform Arduino with Proteus .

Let ‘s run ISIS Schematic:

To simulate the core of Arduino platform we need only a few components: the atmega328P Microcontroller, a Crystal and two Capacitors.Let’ s look for these devices in the library:

Click on “P” button and write atmega as keyword:

Double click on the model and this appears under Devices panel:

Same operations for the Crystal and Capacitor:

Getting Started with Proteus

After installing Proteus , run ISIS Proteus Professional, will appear the following window interface :

Following is a brief description of each part of the function :

1. Schematic Editor window (The Editing Window): As the name implies , it is used to draw the schematic . Blue box as editable area, to put it inside the component . Note that this window is no scroll bar , you can use the preview window to change the schematic visual range .

2. Preview window (The Overview Window): It shows the two elements, one is this: When you are in the component list, select a component, it will show a preview of the element ; Another is that when you mouse focus falls on the principle diagram editor window ( ie, place the component into the schematic editor window Or after the Schematic Editor window, click the mouse ) , it will display the entire schematic diagram of the thumbnails, and will show a green box , green box which is the content of the current diagram window displays the contents of Therefore, you use the mouse to click on it to change the location of the green box , thereby changing the schematic visual range.

3. Model Selection Toolbar (Mode Selector Toolbar):

Main Modes:

1 * Select elements (components) ( selected by default )

2 * Place the connection point

3 * place a label ( the bus will be used )

4 * Place text

5 * for drawing bus

6 * for placing subcircuits

7 * for instant editing component parameters ( first click on the icon and then click the element you want to modify )

Tools:

1 * terminal interface (terminals): There VCC, ground , output, input and other interfaces

2 * Device Pin : for drawing pin

3 * Emulation chart (graph): used for various analyzes, such as Noise Analysis

4 * recorder

5 * signal generator (generators)

6 * Voltage Probe: to be used when using simulation charts

7 * current probe : Using simulation to be used when using simulation charts

8 * Virtual Instrument :  in the image above, an oscilloscope

2D graphics (2D Graphics):

1 * Drawing Lines

2 * draw a variety of boxes

3 * draw various circles

4 * draw a variety of arc

5 * draw various polygons

6 * draw various text

7 * draw symbols

8 * paintings origin , etc.

4 . Component List (The Object Selector):

For the selection of components (components), terminal interface (terminals), the signal generator (Generators), simulation chart (graph) and so on. For example , when you select ” Component (Components) “, click the ” P ” button will open the selected component dialog box, select an element after ( click on the ” OK ” after ) , the device will be displayed in the list of elements , later to use this element, just in the component list can be.

5 . Toolbars direction (Orientation Toolbar):

Rotate :

The rotation angle can be an integer multiple of 90 .

Flip:

Flip Horizontal and vertical flip finish . Use: Right-click the component , and then click ( left-click ) the corresponding rotation icon.

6 . Simulation Toolbar

1 * Run

2 * single-step operation

3 * Pause

4 * Stop

AVR microcontroller simulation example:

We want design an AVR driver for a LCD1602 and monitor it with an oscilloscope data lines. Parts of file formats generated by the compiler are different, such as ICC is COF, IAR is D90, GCC is COF, ELF. Proteus supports files COF, D90, HEX , etc.

Run Proteus Professional , the following window appears :

1, Add the components, in this case ATMEGA16, LM016L (LCD1602), after we’ ll add the oscilloscope.Click the “P” button to select Component dialog box appears

KEYWORDS of the dialog box , enter the ATMEGA16, get the following results :

>

Click OK, and close the dialog box , then the components listed in the list ATMEGA16, also find LM016L. The end result :

2 , place components: the component list, select Left ATMEGA16, in the schematic editor window, click the left button , so ATMEGA16 is placed in the Schematic Editor window . Similarly placed LM016L.

Add “ground” : Left Select model selection toolbar icon appears:

Left selection GROUND, and in the schematic editor window, left-click , so that the “ground” was placed into the Schematic Editor window .

Add Oscilloscope: Left Select model selection toolbar icon appears:

Left selection OSCILLOSCOPE, and in the schematic editor window left click , so that the oscilloscope is placed to the Schematic Editor window.

place components paying attention to place them inside the blue box of workarea.

3 . Connection. AVR, LCD ‘s VSS, VDD, VEE don’t need connections , the default VSS = 0V, VDD = 5V, VEE =-5V, GND = 0V

4 . Add a simulation file. Right click before on ATMEGA16 then select Edit Properties

in the Program File , click the File Browser dialog box, locate lcd_C.hex file, click OK to finish adding files.Set Clock Frequency at 8MHz, click OK to exit.

5 . Simulation

Click Start simulation :

Description: red for high, blue represents low, gray represents uncertainty level (floating). Running in the Debug menu, you can view the AVR related resources.

6 , the source code debugging

Proteus supports COF file debugging. Be sure to create this file in your compiler options.Complete the schematic drawing and add debug files (COF file ) , click:

the AVR Source Code window appears , if the state does not appear in the debugger , go to Debug menu to find .

Let’s say something about these icons

1 * continuous operation , it will exit the single-step debug state , and close the AVR Source Code window

2 * single-step operation , skip directly encountered Functions

3 * single-step operation , will enter its internal encountered Functions

4 * out of the current function , when using 3 * into the internal function , use it immediately on exiting the function returns a function , it should be seen in conjunction with the 3 *

5 * run to the line where the mouse

6 * Add or remove a breakpoint , the breakpoint is set using the program will stop at the breakpoint.

Getting Started with EDWinXP

In this article we ‘ll study a Series Voltage Regulator schematic circuit using the SPICE simulation software EDWinXP. After the installation, run the program

Let’s create a new project selecting Edit Page from MAINPAGE

It opens a new page