Arbitrary Behavioral Sources (Experimental)

Apr 13 2012, 1:45 PM PDT · 1 comment »

We're happy to announce a major upgrade to our simulation backend: voltage and current sources can now become arbitrary behavioral sources. For those not familiar with the tech lingo, it means that voltage and current sources are now "programmable". This feature is currently experimental within CircuitLab, but we wanted to provide you with the power you need to go beyond our included device models.

Let's take a look at a simple modeling example: a TL431 programmable shunt voltage regulator. It's sort of like a Zener diode in that it's a shunt-type device where the incremental resistance becomes tiny past the "on" voltage. However, the TL431 has a third terminal which allows it to be adjustable, and it basically draws as much current from the "cathode" terminal as needed to keep the "reference" terminal at 2.5 volts above the "anode" terminal. The user can then build a simple feedback network, like a resistor divider, to have a programmable shunt voltage reference. Beyond the programmability, the TL431 has another advantage over Zener diodes, which is that its incremental "on" resistance is quite low, so its voltage stays quite steady over varying load currents.

Here's a very simple model built in CircuitLab (from a bigger test circuit we'll link below):

You can see that I2 is a normal current source, drawing 2uA into the reference terminal. But I1 is a current source that's defined by an expression, "MAX(0, (V(REF)-V(ANODE)-2.5)/1m)". That expression means that the current flowing through I2 is the maximum of 0 and the quantity on the right side -- meaning that if the right side is less than 0, the current is just zero, so the current is never negative. The other piece of the expression is "(V(REF)-V(ANODE)-2.5)/1m", which means to take the voltage difference between REF and ANODE nodes, subtract 2.5 volts (which is the built-in reference voltage of the TL431), and then divide by 0.001. That 0.001 is almost like a resistance, where the current varies by 1000 amps for every volt of difference. But here, it's really a transconductance, because the terminals that the current flow through aren't the same terminals whose voltages are being measured.

This is part of a test circuit:

We can run a DC sweep, and demo the parameter sweep options as well to adjust the resistors connected in the external circuit:

Here, we can see that the output voltage is adjustable by the feedback resistors R2 and R3.

Behavioral sources are experimental, but feel free to go ahead and give them a try! Read more about allowed expressions and behavioral sources. Beware that behavioral sources make it very easy to cause convergence problems. We work hard to make sure that CircuitLab-defined built-in models converge in most cases, but arbitrary behavioral sources means that you're on your own. If you're having trouble, feel free to ask for help on the forums and see if another user can help re-structure your equations to achieve the desired effect.

Power User Shortcuts

Apr 13 2012, 1:30 PM PDT · 0 comments »

Available now in the CircuitLab editor are new features that should make the CircuitLab experience much smoother for power users of our tool. We have added a Run menu to the top toolbar that will let you jump straight to running a simulation from build mode. On the menu you will also notice that the F5 key will now run the currently active simulation tab you have open. So, if you have to hop over to build mode to make a quick change in your circuit, you can just hit F5 to run the simulation again.

Run Simulation Screenshot

To complement the ability to quickly jump into a simulation, we've also added the ability to quickly jump into build mode from simulation mode. Just double click anywhere on the grid and it will send you back to build mode so you can edit the schematic.

Advanced Graphing: Powerful Plotting Options

Apr 07 2012, 7:30 PM PDT · 1 comment »

The CircuitLab team is proud to release a major upgrade to the way you can display plots in the CircuitLab editor. Up until now you have only been able to plot all of your signals from the simulator's analysis on a single graph. CircuitLab now supports creating multiple different plots at once, so your traces are no longer cluttered together onto the same graph. This works for CircuitLab's DC Sweep, Time Domain, and Frequency Domain (Small-Signal AC) simulation modes.

CircuitLab Advanced Graphing Screenshot

With today's release of Advanced Graphing you are able to define which traces you want plotted on different graphs, and which traces you want plotted on the same graph. Our intuitive Advanced Graphing interface allows you to drag traces out onto new graphs, change the settings of each individual axis on each graph, and even rearrange the order of the traces.

CircuitLab Advanced Graphing Screenshot

When combined with our powerful plot expressions which we demoed in an earlier blog post, this change should make the presentation and analyzing of the results you get from the CircuitLab simulator much more powerful. Give it a try by clicking on the Advanced Graphing link right above the Run Simulation buttons.

CircuitLab Advanced Graphing Screenshot

As always, all simulation and plotting options are saved right along with your schematic, so you can easily share a circuit's public URL and the recipient will see the same plot configuration when they run the simulations in their browser.

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.