Modeling Home Heating Systems With Circuit Simulation Software

Electricity flow is generally invisible, silent, and not something that most humans want to touch, so understanding how charge moves around can be fairly unintuitive at first. There are plenty of analogies to help understand its behavior, such as imagining a circuit as a pipe of water, with pressure standing in for voltage and flow standing in for current. But you can flip this idea in reverse and use electric circuits to model other complex phenomena instead. [Oxx], for example, is using circuit theory to model his home’s heating systems.

To build his model, he’s using LTSpice, a free circuit simulation program. Using voltage to model temperature and current to model heat flow, he’s set up a model for his home to compare the behavior of a heat pump and a propane furnace. A switch model already in LTSpice with built-in hysteresis takes the place of the thermostat. Using temperature data for a single day in January [Oxx] can see how each of his two heating systems might behave, and the model for the heat pump is incredibly close to how the heat pump behaved in real life.

The model includes all kinds of data about the system, including the coefficient of performance of the heat pump and its backup electric resistive heater, and the model is fairly accurate at predicting behavior. Of course, it takes a good bit of work to set up the parameters for all of the components since our homes and heating systems won’t be included in LTSpice by default, but it does show how powerful an electric circuit analog can be when building models of other systems. If you’ve never used this program before, we’ve featured a few guides to getting started that you can take a look at.

Thanks to [Jarvis] for the tip!

Continue reading “Modeling Home Heating Systems With Circuit Simulation Software”

QSPICE Picks Up Where LTSpice Left Us

[Mike Engelhardt] is a name that should be very familiar to the hardcore electronics nerd. [Mike] is the developer responsible for LTSpice, which is quite likely the most widely used spice-compatible simulator in the free software domain. When you move away from digital electronics and the comfort of software with its helpful IDEs and toolchains, and dip a wary toe into the murky grey waters of analog or power electronics, LTSpice is your best friend. And, like all best friends, it’s a bit quirky, but it always has your back. Sadly, LTSpice development seems to have stalled some years ago, but luckily for us [Mike] has been busy on the successor, QSpice, under the watchful eye of Qorvo.

It does look in its early stages, but from a useability point of view, it’s much improved over LTSpice. Performance is excellent (based on this scribe’s limited testing while mobile.) Gone (thankfully!) is the uncommon verb-noun usage paradigm — replaced with a more usual cut-n-paste flow. Visually it still kind of looks like LTspice in places, but nicer with a clear and uncluttered design that gets straight to the point. Internally, the simulation engine has improved in speed and accuracy, as well as adding native support for modern semiconductor types, such as wide bandgap materials like SiC. Noted is that this updated software has a particular emphasis on power integrity and noise analysis, which are sticky problems that have a big impact on modern high-power systems.

Continue reading “QSPICE Picks Up Where LTSpice Left Us”

Practical Inductors In LTSpice

LTSpice and the underlying Spice engine does a great job of simulating ideal components. But it is also capable — if you know how — of handling models of real-world devices. Inductors, for example, are one of the most imperfect components. Their constituent wire has resistance, and there is parasitic capacitance between the windings. If there is a core, it also will have many imperfections and losses. [Sam Ben-Yaakov] has a lecture about modeling real inductors in LTSpice, and he covers how you can capture some of these imperfections in the video below.

There is a bit of math in the presentation, but we liked that it relates back to datasheets for actual components. Being able to understand what the parameters on a datasheet mean is crucial, and if you ever wondered what some of these entries mean, you’ll get a lot from this video.

The main feature of the model is the flux equation. The tanh (hyperbolic tangent) function is similar to the curve you want for the flux equation, so it plays a major part. Of course, there are other parts of the inductor you may have to model, too, but this is one of the most difficult parts.

You can also model transformers using LTSpice. You can also create custom components.

Continue reading “Practical Inductors In LTSpice”

Freq Out With LTSpice

We always enjoy [FesZ’s] videos, and his latest about FREQ function in LTSpice is no exception. In fact, LTSpice doesn’t document it, but it is part of the underlying Spice system. So, of course, you can figure it out or just watch the video below. The FREQ keyword allows you to change component attributes in a frequency-depended way.

Of course, capacitors and inductors are frequency dependent by design. But the FREQ technique allows you to adjust things like voltage sources or resistance in arbitrary ways. By default, you must specify the frequency response data in decibels, which isn’t always convenient. However, [FesZ] shows you how to use other methods to express them using modifiers to the command.

Continue reading “Freq Out With LTSpice”

IBIS Models Explained

If you’ve worked with circuit simulation, you may have run into IBIS models. The acronym is input/output buffer information, and while you can do a lot without having to deal with IBIS, knowing about it can help you have a successful simulation.

IBIS is an industry-standard format that uses ASCII text to describe voltage versus current and voltage versus time about some device’s digital input and output pins. This allows precise simulation without revealing the device’s internals, which is important to some vendors. The first post of this two-part series talks about what IBIS is and how it got started. The second part explains creating and using LTSpice to create your own IBIS models. It also covers why you might want to do that.

Of course, if you don’t care about revealing the internals of a device, you could just create a Spice simulation. However, many tools will accept both models, so it is useful to know how to produce either kind of model. In fact, to create an IBIS model, you’ll want to use a Spice model to generate the data for the IBIS model, so it is a good bet you’ll have both, even if you choose to only publish the IBIS models.

If you need a refresher on Spice, we have a series. If you prefer using something different, try Micro-Cap 12, which was commercial, but went free a few years ago.

OpenSPICE: A Portable Python Circuit Simulator

[Roman Parise] and [Georgios Is. Detorakis] have created OpenSPICE a fork of the PySpice project, adding a new simulation engine written entirely in Python. This enables the same PySpice simulations to be executed on any platform that runs python (which we reckon is quite a few!) whilst leveraging the full power of the python infrastructure. Since it is a fork — for supported platforms — you can also run your simulations upon Ngspice as well as Xyce, giving options for scaling up to larger systems when required, but importantly without having to recreate your circuit from scratch.

The OpenSPICE simulator first converts the parsed netlist into a set of data structures that represent the equations describing the various parts of the system. These are then in turn passed along the scipy library “optimize.root” function which solves the system, generating a list of branch currents and node voltages. The output of the simulation is a numpy array, which can be further processed and visualized with the mathplotlib library. All pretty standard stuff in python circles. Since this is based upon PySpice, it’s also possible to use KiCAD netlists, so you have a nice way to enter those schematics. We’ve not dug into this much yet, but support for the vast libraries of spice models out there in circulation would be high up on our wish list if it already can’t handle this. This scribe will most definitely be checking this out, as LTSpice whilst good, is a bit of a pain to use and does lack the power of a Python backend!

Continue reading “OpenSPICE: A Portable Python Circuit Simulator”

Measuring Impedance Virtually

We always enjoy a [FesZ] video and we wonder if the “Z” stands for impedance? That’s the topic of his latest video series: measuring impedance with LTSpice. Of course, he also does his usual thorough job of mapping the virtual world to the real one. You can see the video below.

It is simple enough. Impedance is very similar to resistance. That is to say, we have a ratio of voltage and current. However, since it is an AC quantity, you need a complex number to represent it and there is an associated phase shift.

Continue reading “Measuring Impedance Virtually”