Saturday, March 17, 2012

Circuit simulation: How to do it

If you intend to make a cool machines in this day and age, sooner or later you'll have to learn/do electrical engineering.

Circuit simulation will save you money and time. It's cheaper than buying parts you don't need or turning the ones you need into smoke. It's faster than soldering and unsoldering things.

It also has a higher barrier to entry than playing with physical objects. This is because the software for circuit simulation is designed to be as intuitive as electricity itself. So let me walk you though it.



The most common, most powerful, and frankly best software is Orcad's PSpice. You can get the 'lite' version free and it does almost everything.

Orcad sells a million other products and you don't want them. You only want 'capture' and PSpice.



Once you download and install it, open Capture and only Capture. If you have PSpice open first when you open Capture it won't work right, seriously. Capture is the circuit designing software. PSpice is the analysis system that Capture will automatically launch when the time comes.

Once you're in Capture, make a new project. If it asks you about inheritance, just set it to no inheritance, that will only confuse things. You want the 'Mixed Analog and Digital' style project. Eventually you should end up on a blank screen that has icons on the side for placing wires and whatnot but no parts. If you click on the parts icon you'll see nothing.




This is because you have no libraries loaded. Capture/PSpice is built for high-end engineers who will be importing all sorts of really specific and complex circuit parts. They want just fucking-exactly the parts they use. That's not your problem, you want the simple stuff.

Import the ones under 'pspice'. In practice they seem to be the only ones that will work in a simulation. Probably because they're the one ones with 'pspice' models.



Now that you actually have parts to place, make a circuit. And when you're done making it, add traces to it. When the simulation for this circuit runs it will only show you data about the traces you add.



When the circuit is done, now make a simulation. The simulation will have parameters like start-time, end-time and a bunch of others. For now, only fiddle with the start and end time.



When you're done setting up the simulation, hit 'run'. This will launch PSpice, the computer will do a bunch of thinking, and then it will tell you what your circuit has been doing.

If you get errors here, maybe you had PSpice up already and you need to close it all first. Maybe you added parts that have parameters that you didn't fill out. Other than that, don't be afraid to google it. Orcad's PSpice is very opaque and the internet is filled with chats from people who are frustrated trying to do the same should-be-simple task you are.

3 comments:

  1. Do you use LTSpice at all? Somehow that became my default sim program...

    ReplyDelete
  2. No. Have you tried both? Comparison?

    ReplyDelete