This is only a preview of the December 2020 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Circuit Surgery
Regular clinic by Ian Bell
Micro-Cap 12 simulator
C
ircuit surgery articles often include LTspice
range of manufactures. LTspice’s library is dominated by Linear
Technology and now Analog Devices components (Analogue
simulations. Of course, LTspice is not the only SPICE
simulator available, however, many require the payment of expensive licence fees. One
example of this was Micro-Cap from Spectrum
Software, which had been a commercial product
for nearly 40 years. Gerald DeSantis emailed PE to
alert us to the fact that this software, which used
to cost $4500, was made available as a free download (for version 12) in July 2019. The owners of
Spectrum Software decided to close the business
and provide the final version of the software at no
cost. We don’t know why this happened, but given
it has been around for 40 years it may be simply
that the developer decided to retire and make the
software freely available, rather than just removing it. Various versions are available for download
from Spectrum Software (www.spectrum-soft.com)
but earlier versions (9 and below) still require an
existing license security key. Download the ‘Full
CD’ version if you are a new user.
Gerald regards Micro-Cap 12 as one of the best
SPICE simulation programs. I was aware Micro- Fig.2. Full Micro-Cap 12 user interface during schematic editing.
Cap existed but had never had access to a licence. I
found that it was easy to download and install but
have not had time to evaluated it in detail – so this
article is a ‘heads up’ rather than a review or tutorial,
and I will look at a few key features and some very
general comparisons with LTspice. I have no reason
to believe that it is not very good as Gerald suggests
– it certainly seems to be feature rich.
From a quick look, it has a more comprehensive
user interface than LTspice, meaning that it might be
easier to set up and run simulations which require
more user input than just drawing the schematic
and hitting the run button. For example, where
model parameters have to be changed / set up, or
when attempting to optimise component values (eg,
stepping through a range of values). Micro-Cap also
allows you to control more complex simulations via
the menus (we will look at an example of this later).
Library
A plus point for Micro-Cap 12 is that it has a large
library of around 45,000 components from a wide
Fig.1. RLC sample circuit Micro-Cap 12 Schematic.
54
Fig.3. Component configuration window – this example is to set up the pulse
voltage source used in the circuit in Fig.1.
Practical Electronics | December | 2020
Fig.4. Micro-Cap 12 Transient Simulation Set Up Window.
the Help menu (sample
circuits item). These
provide insights into
using software features
as well some interesting
example circuit designs
(the LTspice download
also includes plenty
of examples). As with
LTs pi ce, you w i l l
find tutorials online.
Gerald recommended
Kiss Analog’s YouTube
channel, which has a
number of useful videos
on Micro-Cap. For anyone interested in analogue circuit design
and simulation it is certainly worth investigating.
Schematic
Fig.5. Transient simulation of step input applied to the circuit in Fig.1.
Devices took over LTspice when they acquired Linear Technology
in 2017 – it was Linear Technology which created LTspice). This
tie to a semiconductor manufacturer’s products allows a very
high-quality simulator to be made available for free – it does of
course help promote Analog/LT products. Devices from other
vendors can be simulated in LTspice, but it may require a bit
more effort to import the models. Micro-Cap is not device/vendor
specific, so it can provide a wide range of models – its business
case was not based on device promotion.
Micro-Cap 12’s library and simulation capabilities also seem
to provide better support for digital circuit simulation (or mixed
analogue and digital). LTspice can simulate logic gates and flipflops, but its capabilities and library are somewhat limited – this
is because LTspice is not really aimed at larger digital circuits, its
digital capabilities are more focused on tightly coupled mixed
analogue and digital. Micro-Cap 12 has a native event-driven
digital simulator. It has high, low, rising, falling, unknown and
high-impedance logic states and the ability to set the drive
strength of outputs to cover situations where multiple outputs
are connected together. It has a library of over 2000
standard digital parts, including those from various
4000 and 74 series families.
An example Micro-Cap 12 schematic is shown in Fig.1 – this is
a basic RLC circuit from the sample circuits provided with the
download. The schematic editor looks straightforward to use –
basic components are available on toolbar buttons, similar to
LTspice, and a window to the side of the editor provides access
to the large library of components. The screenshot in Fig.2 shows
the whole user interface during schematic editing, although this
is with the window smaller than you normally use it. In the
screenshot, an op amp has been selected from the library and
could be added to the schematic.
Double clicking on a component brings up a window which
allows it to be configured (values set). Fig.3 shows the window
for setting up the voltage source in the circuit in Fig.1. The
source is set up to produce pulses with a 1µs duration and a
2µs period, with rise and fall times of 10ns, which start after
a delay of 100ns. The screenshot illustrates the detailed and
comprehensive nature of the user interface, which seems
typical in Micro-Cap 12.
Simulation
Running a transient simulation (Analysis > Transient from the
main menu) for the circuit in Fig.1 results in the waveforms shown
in Fig.5. The sample circuit transient analysis set-up initially
only shows the output wave (red), but it is straightforward to add
the input wave (green) to the plot when selecting the transient
simulation – see Fig.4. The Add button allows additional plots
and traces to be added, with details entered in the table at the
bottom of the window. When the set-up is run the Run button
starts the simulation, producing the results shown in Fig.5. The
simulation is configured to run for 1µs (see max run time in
Fig.4) so we only see the first edge of the initial pulse. Double
clicking the trace names allows many things to be configured,
such as line colour and thickness.
Maintenance
An obvious potential problem with Micro-Cap 12 is
how long it will continue to be usable – if software
development has stopped it is likely to become
incompatible with up-to-date operating systems at
some point. However, it is difficult to predict how long
it will last without maintenance (assuming there will
be none). Another issue – if you have already spent
time learning LTspice (or another simulator) – is the
learning curve for a new software package. However,
there is a detailed reference manual and a large library
of example (sample) circuits which can be opened via Fig.6. Interface for setting up value stepping in a simulation.
Practical Electronics | December | 2020
55
Fig.7. Transient simulations with value of R1 in Fig.1 stepped from
30Ω to 70Ω in steps of 10Ω.
The basic simulation described so far more or less parallels the
same process in LTspice. However, as mentioned earlier MicroCap 12 provides some more capabilities directly via menus.
One example of this is component value stepping. This is a
useful process which enables a designer to quickly investigate
the effect of changing a circuit parameter on its performance
or behaviour. For example, we might want to investigate the
effect of varying the resistor (R1) value on the shape of the
output waveform for the circuit in Fig.1. To do this in LTspice
we have to write a text command (SPICE directive) to define
a parameter for the resistor value and another to configure the
stepping. It is not particularly difficult, but it is less obviously
available and less convenient to quickly alter than the dialog
window for the same purpose provided by Micro-Cap 12 (see
Fig.6). This can be accessed by clicking the Stepping button in
transient simulation set-up, or from the Transient menu after
the simulation has been run.
Fig.6 shows R1 set up to be stepped from 30Ω to 70Ω in 10Ω
steps. The ‘Step It’ check box has to be on for the stepping to
be applied. The tabs in the window allow more values to be
selected for stepping. The results of running the simulation
with the stepping set up are shown in Fig.7. There are multiple
traces for V(out) corresponding with the various R1 values.
Hovering the cursor over any of the traces produces a ‘tooltip’type box which informs you of the relevant R1 value. Stepping
can be used to help quickly select the best component value
Fig.8. Filter Designer with design settings for a Chebyshev lowpass filter.
56
Fig.9. Filter Designer implementation settings – note scaling factor
and op amp choice.
if you are not certain what to use, or do not know how, or are
too lazy to calculate it.
Another design procedure related to value stepping is Monte
Carlo simulation. This varies selected component and model
values statistically to simulate the normal variation in values
inherent in manufacturing processes. As many of you will have
guessed, the name is inspired by the fame of Monte Carlo’s casinos
(another statistical process!). This can be used to check that the
performance of mass-produced circuits (particularly integrated
circuits) will be within specifications given the variations present
in the components (‘process variations’ in integrated circuit
terminology). It is more complex to set up than stepping and
we will not go into the details here. Like stepping, both LTspice
and Micro-Cap 12 can perform Monte Carlo simulation, but
again, Micro-Cap 12 has dialogs to help set it up, whereas with
LTspice you have to use text commands (you can also write text
commands in Micro-Cap 12). Furthermore, if you search LTspice’s
help you will not find anything about Monte Carlo simulation,
but Micro-Cap 12 has plenty of entries. Of course, you can find
Fig.10. Idealised frequency response for the filter design from
Fig.8 and 9.
Practical Electronics | December | 2020
is the output produced by a pulse from 0V to 1GV and lasting
10-9 seconds (ideally it has an amplitude that tends to infinity
and a duration that tends to zero, but the area under the pulse
is 1). Impulse responses are important in the mathematical
analysis of filters.
Fig.10 and 11 show examples of the Bode and steps plots.
These graphs are based on the standard polynomial formula for
the selected filter response and will only be produced by ideal
circuits. The filter designer creates a circuit schematic which
contains models of real components (eg, the specified op amp
device) – for example see Fig.12. The schematic was produced
by selecting the ‘Circuit’ rather than ‘Macro’ option in the options
tag – this is simpler to work with for a quick simulation than
the hierarchical schematic created by the default macro option.
Filter Simulation
Fig.11. Idealised step response for the filter design from Fig.8 and 9.
the LTspice instructions online, but the lack of comprehensive
built-in help can be difficult when first using LTspice.
Filter Design
Micro-Cap 12 includes a filter design facility (Design > Active
Filters or Passive Filters from the menu). This enables you to
specify the filter requirements, from which it can create filter
schematics. It is potentially very useful and there is nothing like
it in LTspice, which is focused on simulation, rather than other
design tools. The Micro-Cap 12 Filter Designer can produce all
the basic types (low-pass, high-pass, bandpass…) with various
responses (eg, Butterworth, Chebyshev, Bessel) and in a variety
of implementations (passive filters and active filters such as
Sallen-Key, MFB, Tow-Thomas...). Not all combinations are
possible because not all filter types can produce the whole list
of response types.
The Active Filter Designer dialog has three settings tabs to
configure the filter requirements and options. Fig.8 shows an
example set up for a 1.0kHz, low-pass, Sallen-Key Chebyshev filter
with 2dB pass-band ripple. The diagram next to the filter-type
selection defines the parameters which are used to specify the
filter. The default circuit uses 10nF and 100pF capacitors, which
results in large resistor values. The next tab – implementation
(see Fig.9) – allows you to change the Impedance Scale Factor
(here it was changed from 1 to 0.01), which multiplies all resistor
values and divides all capacitor values to help set practical
values. You can also choose the op amp (ideal or real devices
– an LM308 is selected in Fig.9) and various other things. The
options tab provides yet more choices such as display formats
for component values.
Clicking the buttons at the bottom of the Active Filter Designer
dialog allows you to see idealised frequency (Bode), step and
impulse response curves for the filter. The Bode plot is a graph
of gain against
frequency. The
step response
is the output
produced by an
instantaneous
voltage step at
the input from
0V to 1V. The
Fig.12. Schematic created by the Filter Designer. impulse response
Practical Electronics | December | 2020
Fig.13 shows a frequency response (AC analysis) for the circuit in
Fig.12. The analysis is run from the main menu and starts with a
dialog similar to Fig.4 for the transient analysis. The frequency
range may need to be changed (from the default) in the AC
analysis dialog to one suitable for the filter being investigated.
Here, 100Hz to 100kHz was selected to match Fig.9.
The switch in Fig.12 illustrates another feature of Micro-Cap
12 – dynamic simulation updates. Double clicking the switch
changes its position and reruns the analysis with the new
situation. In this case it makes no difference because the two
pulse sources behave the same for an AC analysis, but in general
it is a useful facility.
From Fig.13 we see that the real circuit does not have the
same frequency response as the ideal filter (shown in Fig.10).
The response is fine until just over 10kHz, at which point the
gain starts rising rather than continuing to fall, as it does in the
ideal case. This is a known issue with Sallen-Key filters and is
related to changes in output impedance as frequency increases.
Here it serves as a nice illustration of the process of using the
Filter Designer – we quickly check the ideal response to make
sure that the design values were entered correctly and then
simulate a more realistic version of the circuit. In this example,
if the response shown in Fig.13 is not adequate, we could select a
different op amp or run the filter designer again using a different
implementation, such as MFB (multiple feedback), which is less
susceptible to the observed problem.
Features
We have only looked at a few of the features of Micro-Cap 12 in
this article. Some others include – ‘smoke analysis’, which looks
at maximum operating values; optimisers for maximising circuit
performance; analogue behavioural modelling (we looked at this
for LTspice in August 2020); 3D plots; animated schematics with
graphical objects such as meters and seven-segment displays;
and netlist export to some PCB design tools. For a quick run
through these, and other capabilities, take a look at the ‘Features
Tour’ on the Spectrum Software website.
Fig.13. Simulation of the circuit in Fig.12 – compare with the ideal
response in Fig.10.
57
|