<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gaussmarkov: diy fx &#187; LTSpice</title>
	<atom:link href="http://gaussmarkov.net/wordpress/category/tools/software/ltspice/feed/" rel="self" type="application/rss+xml" />
	<link>http://gaussmarkov.net/wordpress</link>
	<description>guitar stompboxes and electronics</description>
	<lastBuildDate>Sat, 05 Jun 2010 15:42:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LTSpice AC Analysis with the BMP Tone Stack</title>
		<link>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-ac-analysis-with-the-bmp-tone-stack/</link>
		<comments>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-ac-analysis-with-the-bmp-tone-stack/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 00:28:14 +0000</pubDate>
		<dc:creator>gaussmarkov</dc:creator>
				<category><![CDATA[LTSpice]]></category>

		<guid isPermaLink="false">http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-ac-analysis-with-the-bmp-tone-stack/</guid>
		<description><![CDATA[
One useful application of SPICE is to see how a tone stack behaves.  Looking at tone stacks is so interesting that Duncan Munro (Duncan Amplification) wrote a now famous computer program, the Tone Stack Calculator (TSC), in 1999 that is still in wide use today.  You can download the Windows application from the [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://gaussmarkov.net/ltspice/DTSC - bmp - blend - acplot.png" title="BMP tone stack AC plots" alt="BMP tone stack AC plots" height="314" width="454" /></p>
<p>One useful application of SPICE is to see how a tone stack behaves.  Looking at tone stacks is so interesting that Duncan Munro (Duncan Amplification) wrote a now famous computer program, the Tone Stack Calculator (TSC), in 1999 that is still in wide use today.  You can <a href="http://www.duncanamps.com/tsc/download.html" title="Download the TSC from Duncan Amplification" target="_blank">download the Windows application</a> from the Duncan Amplification site. This tutorial shows how to use LTSpice to make the same calculations as the TSC for the tone stack of the Big Muff Pi (BMP).<span id="more-92"></span></p>
<p>DIY stompbox builders often add the BMP tone stack onto circuits without tone controls.  Using only one potentiometer, this tone stack produces a high pass filter, a low pass filter, and a mid scoop. That&#8217;s a lot of choices without requiring the common trinity of pots (bass, mid, and treble).  The BMP stack uses the single potentiometer to blend a high pass filter with a low pass filter. Fully counter clockwise (CCW), almost all of the output comes from the low pass filter (shown above in red) and fully clockwise (CW) it&#8217;s almost all high pass filter (shown in blue).  In between, the pot blends the two in various amounts as seen in the green lines in the graph above.</p>
<p>First, following the instructions below, make the following schematic for the tone stack in LTSpice (or download it <a href="http://gaussmarkov.net/ltspice/ltspice%20-%20duncan%20tsc%20-%20bmp.zip" title="LTSpice files for BMP tone stack tutorial">here</a>):</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DTSC%20-%20bmp%20-%200%20-%20schem.png" title="DTSC - BMP schematic" alt="DTSC - BMP schematic" /></p>
<p>If you need help with placing components or wiring on the schematic, look at <a href="http://gaussmarkov.net/wordpress/tools/software/ltspice/an-ltspice-tutorial/">An LTSpice Tutorial</a>.</p>
<p>The high pass filter (HPF) consists of C1 and R2 where the output is taken at their junction. The low pass filter consists of R1 and C2 where, again, the output is taken from their junction. If you would like to read more about such passive resistor-capacitor (RC) filters, check out <a href="http://gaussmarkov.net/wordpress/parts/capacitors/capacitors-4-low-pass-filters/" rel="bookmark" title="Permanent Link to Capacitors 4: Low Pass Filters">Low Pass Filters</a> and <a href="http://gaussmarkov.net/wordpress/parts/capacitors/capacitors-5-high-pass-filters/" rel="bookmark" title="Permanent Link to Capacitors 5: High Pass Filters">High Pass Filters</a>.</p>
<p align="left"> To label a net like the <em>IN</em>, <em>OUT</em>, <em>HPF</em>, and <em>LPF</em> nets on this schematic, use the <em>Label Net</em> entry on the <em>Edit</em> menu. There is a button for this command between the ground and resistor symbols of the tool bar. You can also start the command with function key 4 (F4). A net label serves the same purpose as on a normal schematic, to abbreviate wiring. It is also useful for labelling graphs. If you look again at the graph above, you will see the blue label <em>V(hpf)</em> that indicates blue is for the voltage on the <em>HPF</em> net.</p>
<p> The 100K linear pot in the BMP tone stack is represented by the voltage divider made by R4 and R5. For starters, the pot is &#8220;set&#8221; at 12 o&#8217;clock with 50K on each side of the voltage divider. Later in this tutorial, LTSpice will vary the pot setting to produce the opening graph. If you would like to read more about voltage dividers, see the page about <a href="http://gaussmarkov.net/wordpress/parts/resistors/resistors-in-series/" rel="bookmark" title="Permanent Link to Resistors 4: In Series">resistors in series</a>.</p>
<p><img src="http://gaussmarkov.net/ltspice/LTSpice%20-%20Voltage%20Source%20-%20V1.png" title="Setting Voltage Attributes" alt="Setting Voltage Attributes" align="right" height="138" width="337" />There are only two other elements for this schematic, the AC voltage source V1 and the so-called <em>load</em> resistor R3. Use the standard voltage source and then edit its properties to produce the AC properties. After right-clicking on the voltage source, you must click on the button labelled <em>Advanced</em> and fill in the dialog window as shown here:</p>
<p style="clear: both" align="center"> <img src="http://gaussmarkov.net/ltspice/LTSpice%20-%20AC%20Voltage%20Source.png" title="AC Voltage Settings " alt="AC Voltage Settings " height="395" width="592" /></p>
<p align="left">A key SPICE command in this file is the AC analysis command</p>
<blockquote>
<p align="left">.ac dec 50 10 30K</p>
</blockquote>
<p align="left">LTSpice helps to enter such commands through its menus. Open the <em>Simulate</em> menu and choose the <em>Edit Simulation Cmd</em> entry. Click on the <em>AC Analysis </em>tab and you will see this window:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/LTSpice%20-%20AC%20analysis.png" title="LTSpice AC analysis window" alt="LTSpice AC analysis window" height="347" width="446" /></p>
<p align="left">I have filled in some values to get a graph that looks like the one in the TSC.   After you click on <em>OK</em>, you will have a cursor that looks like a box and you must click somewhere on your schematic to actually insert the command into the schematic.  Sometimes I forget to do this and the simulations don&#8217;t work. Fortunately when you go back to the <em>Edit Simulation Cmd </em>window your previous entries are still there.</p>
<p align="left">Now if everything looks the schematic above, choose the <em>Run</em> entry of the <em>Simulation</em> menu. A blank, black graph will appear. Click on the <em>OUTPUT</em> label or net and this graph should show up:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DTSC%20-%20mid%20point%20output%20with%20phase.png" height="265" width="450" /></p>
<p align="left">The dashed line shows the phase shift of the filter. Remove that phase plot by clicking on the left-hand phase scale and then clicking on the &#8220;Don&#8217;t plot phase&#8221; button. Now you should see this:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DTSC%20-%20mid%20point%20output.png" height="265" width="450" /></p>
<p align="left">That is the same graph that you will see if you open the BMP window of Duncan&#8217;s TSC. This is a mid scoop with the bottom of the scoop at 1KHz. The output of the filter is graphed in decibels. Notice that for all frequencies the output is attenuated. That is indicated by the negative decibel values. All passive tone stacks have this attenuation property and you will often see so-called <em>recovery stages</em> after them in stompbox circuits to amplify the signal before the output.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-ac-analysis-with-the-bmp-tone-stack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LTSpice Analysis and the DOD Overdrive 250</title>
		<link>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-analysis-and-the-dod-overdrive-250/</link>
		<comments>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-analysis-and-the-dod-overdrive-250/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 03:15:48 +0000</pubDate>
		<dc:creator>gaussmarkov</dc:creator>
				<category><![CDATA[LTSpice]]></category>

		<guid isPermaLink="false">http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-analysis-and-the-dod-overdrive-250/</guid>
		<description><![CDATA[
Here is a run through the kind of calculations one can do with LTSpice using the DOD Overdrive 250 circuit as an example. You can download the LTSpice circuit (schematic) file for the DOD Overdrive 250 and related files (some taken from the Yahoo LTSpice group) in DOD250-LTSpice.zip. In some future tutorials, I will go [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://gaussmarkov.net/ltspice/DOD250%20-%20schem.png" title="DOD250 LTSpice schematic" target="_blank"><img src="http://gaussmarkov.net/ltspice/DOD250%20-%20schem%20thumb.png" title="DOD250 LTSpice Schem thumbnail" alt="DOD250 LTSpice Schem thumbnail" height="267" width="469" /></a></p>
<p>Here is a run through the kind of calculations one can do with LTSpice using <a href="http://gaussmarkov.net/wordpress/circuits/overdrive-250/">the DOD Overdrive 250 circuit</a> as an example. You can download the LTSpice circuit (schematic) file for the DOD Overdrive 250 and related files <span id="more-91"></span>(some taken from the <a href="http://groups.yahoo.com/group/LTspice/" target="_blank">Yahoo LTSpice group</a>) in <a href="http://gaussmarkov.net/ltspice/DOD250-LTSpice.zip">DOD250-LTSpice.zip</a>. In some future tutorials, I will go into more detail.  Also, if you look through the electronics tutorials in <a href="http://gaussmarkov.net/wordpress/category/parts/">the Parts category</a> of this site you will see some basic examples of LTspice schematics.</p>
<p>As my introductory post (<a href="http://gaussmarkov.net/wordpress/tools/software/ltspice/an-ltspice-tutorial/">An LTSpice Tutorial</a>) shows, an LTSpice file looks very much like a schematic. At the top is a thumbnail picture of the LTSpice schematic that I have made for the DOD Overdrive 250. If you click on it, you can see a larger, more readable, version in a new browser window.  Instead of a step-by-step tutorial, this time I will just comment briefly on some of the elements of this LTSpice schematic that you do not see on ordinary schematics.</p>
<p>The text in the upper left-hand corner contains a text title in blue and several lines in black that begin with periods.  The black lines contain so-called &#8220;dot commands&#8221; that give instructions to load additional code for the SPICE simulation (the &#8220;.include&#8221; commands) and additional instructions to compute a &#8220;transient&#8221; analysis three times, for three different values of the &#8220;wip&#8221; parameter. SPICE simulations are driven by a programming language, much of it managed by the LTSpice schematic diagram.  But there may still be some leftover programming like these dot commands.</p>
<p>Some of the components on the schematic have extra characteristics written next to them. The resistors, capacitors, diodes, and IC all look familiar.  But the potentiometer (or pot) has additional material. Two components, the voltage sources V1 and V2, usually do not even appear on schematics. These components are additional parts for programming the SPICE simulations. The key features shown are that the AC input signal will be a sine wave with a 100mV amplitude and 800Hz frequency and that the Gain pot is a reverse audio pot with a total resistance of 500K with its wiper set at a rotation determined by the &#8220;wip&#8221; parameter just mentioned.</p>
<p>This LTSpice file produces the following figure, which shows the output for three different settings of the Gain pot:  10%, 40%, and 80% rotation.</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DOD250%20-%20clipping.png" title="DOD25 clipping figure" alt="DOD25 clipping figure" height="314" width="500" /></p>
<p>The green wave corresponds to 10% rotation. There is some amplification because the peaks and troughs are beyond 300mV.  There is even a hint of the clipping caused by the diodes at the output of this circuit.</p>
<p>The diode clipping is very clear in the blue wave, which corresponds to 40% rotation.  The asymmetry of the diode clipping is also clear.  This comes from having two diodes in series for one side of the clipping versus only one for the other.</p>
<p>The op amp clipping appears in the red wave, which corresponds to 80% rotation.  The asymmetry from the diode clipping is still present but the hard clipping that comes from hitting a power rail is also prominent.</p>
<p>As a second example, I will show one way you might determine the input impedance.  By definition of input impedance, I must to find the voltage divider that makes the source resistance equal to the input resistance. In effect, the input impedance equals the source resistance that halves the source amplitude. So first I introduce a source resistance R9 as this figure shows:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DOD250%20-%20input%20impedance%20schem.png" title="DOD250 LTSpice input impedance figure" alt="DOD250 LTSpice input impedance figure" height="282" width="460" /></p>
<p>With LTSpice, I am going to measure the amplitude of the signal at the spot labelled &#8220;junction&#8221; for different values of R9.  So R9 has been assigned the value &#8220;imped&#8221; which is varied from 500K to 1.5M in increments of 500K by a new dot command. I will hold the frequency and amplitude of the source at the values that we used before.  And I will fix the Gain pot at 40% rotation.	 The three resulting waves at <em>Junction</em> are shown below:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DOD250%20-%20input%20impedance.png" title="DOD250 input impedance figure" alt="DOD250 input impedance figure" height="316" width="494" /></p>
<p>The 1M value is just about perfect.  That source resistance gives an amplitude of almost 50mV, which is half of 100mV.  So for an 800Hz input signal, the input impedance of the DOD Overdrive 250 is about 1M ohms.  You might guess at this point, correctly, that the 1M pull up resistor R2 is responsible for this value.</p>
<p>As a final example to whet your appetite, I will compute the frequency response of the DOD Overdrive 250 circuit.  I replaced the .tran command shown above with &#8220;.ac oct 40 20 20K&#8221; and created this graph:</p>
<p align="center"><img src="http://gaussmarkov.net/ltspice/DOD250%20-%20frequency%20analysis.png" title="DOD250 frequency analysis figure" alt="DOD250 frequency analysis figure" height="316" width="494" /></p>
<p>The three graphs are for the same three settings of the Gain pot.  At a 10% rotation, there is modest amplification and the frequency response is fairly flat.  By the time op amp clipping has set in a mid hump has appeared, a popular profile for distortion circuits.</p>
<p>There is lots more that we can do.  Using LTSpice as a virtual bench, I have managed to learn how a constant current source (CSS), a voltage controlled oscillator (VCO), and a low frequency oscillator (LFO) all work.  Because the internet is a rich but spotty source of information, LTSpice has been a great way to confirm an understanding, or to reveal misunderstandings.  I will keep fleshing out this section of gaussmarkov.net in the hope that it will help others as well.  Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://gaussmarkov.net/wordpress/tools/software/ltspice/ltspice-analysis-and-the-dod-overdrive-250/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>An LTSpice Tutorial</title>
		<link>http://gaussmarkov.net/wordpress/tools/software/ltspice/an-ltspice-tutorial/</link>
		<comments>http://gaussmarkov.net/wordpress/tools/software/ltspice/an-ltspice-tutorial/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 17:38:30 +0000</pubDate>
		<dc:creator>gaussmarkov</dc:creator>
				<category><![CDATA[LTSpice]]></category>

		<guid isPermaLink="false">http://gaussmarkov.net/wordpress/uncategorized/an-ltspice-tutorial/</guid>
		<description><![CDATA[Learning how a circuit works or designing a new one requires experimentation.  Besides 	actually building a circuit, many people use a circuit simulation program.  LTspice/SwitcherCAD III is a free program (download link) that many forumites use.  Here is a brief introduction to using LTspice, illustrating a calculation with Ohm&#8217;s law.  This [...]]]></description>
			<content:encoded><![CDATA[<p>Learning how a circuit works or designing a new one requires experimentation.  Besides 	actually building a circuit, many people use a circuit simulation program.  LTspice/SwitcherCAD III is a free program (<a href="http://www.linear.com/company/software.jsp">download link</a>) that many forumites use.  Here is a brief introduction to using LTspice, illustrating a calculation with <a href="http://gaussmarkov.net/wordpress/parts/resistors/resistors-limiting-current/" title="Ohm's law">Ohm&#8217;s law</a>.  This tutorial first appeared on February 27, 2007 on the pre-WordPress version of this site.<span id="more-88"></span></p>
<p>When you first open the LTspice window, you will see something like this image. To create a schematic, either</p>
<ol>
<li>click on the new schematic tool bar button beneath the menus on the far left or</li>
<li>choose the <em>File &gt; New Schematic</em> menu item.</li>
</ol>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/newschem.PNG" title="LTSpice new schematic button" alt="LTSpice new schematic button" height="339" width="361" /></p>
<p>The window will change to a background that shows the grid for laying out the schematic.  Also the toolbars beneath the menus become active.</p>
<p style="text-align: center"><img src="http://gaussmarkov.net/tools/LTspice/component.PNG" title="LTSpice new component button" alt="LTSpice new component button" height="339" width="361" /></p>
<p>For example, you can see the symbols for ground, a resistor, and a capacitor are available elections.  In the picture above, the <em>Component</em> button is highlighted. To the left is a diode symbol and to the right is the image of a hand. After clicking on the <em>Component</em> button, we will select a voltage source for our schematic.</p>
<p>Below is the dialog window that opens after clicking on the <em>Components</em> button.  After scrolling through the alphabetical list on the bottom, we have selected the voltage source symbol.  Clicking on the <em>OK</em> button returns us to the schematic where we can place this symbol by clicking in a desired location.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/voltage.PNG" title="LTSpice voltage component" alt="LTSpice voltage component" height="445" width="434" /></p>
<p>In the next picture, you can see where we have placed the voltage source. The <em>Resistor</em> button is highlighted because we are about to add a resistor to our schematic.  We will place all of the components that we need first. Then we will place connections and finally we will assign values to the components.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/resistor.PNG" title="LTSpice new resistor component" alt="LTSpice new resistor component" height="339" width="444" /></p>
<p>After placing the resistor, we are about to add a <em>Ground</em> symbol to our schematic.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/ground.PNG" title="LTSpice ground component" alt="LTSpice ground component" height="339" width="444" /></p>
<p>The ground symbol is now in place and we are about to place wires to connect the components of our simple circuit.  To run the connections, press F3 or click the <em>Wire</em> button (a pencil to the left of the <em>Ground</em> button) or choose <em>Wire</em> from the <em>Edit</em> menu.  Click to start a wire and to make a corner. Double click to end a wire.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/wire.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>Here is the completed circuit for illustrating Ohm&#8217;s law. Component values can be assigned by placing the mouse over a component and right-clicking.  If you make the the mouse a pair of crosshairs (by pressing the ESC key), then the mouse will turn into a hand as it is placed over the component.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/wired.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>Right-clicking on the voltage source component brings up the dialog window below. We are assigning the value 9 for 9 volts of direct current (DC).  There are other options that we ignore for this tutorial.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/9v.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>Now you will see that the letter <em>V</em> underneath the voltage supply symbol has been replaced by the value 9.  We also right-clicked on the resistor component and assigned the value 1K.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/1K.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>Having assigned all of the components values, we are ready to simulate the circuit in the schematic. To do this, we must create a command for <em>SPICE</em>, the algorithm that computes the simulations.  Choose the <em>Simulate &gt; Edit Simulation Cmd</em> menu item.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/editsim.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>This dialog appears.  We have selected the <em>DC opt pnt</em> tab.  This is the  choice for a simple DC simulation.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/DCop.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>After clicking on <em>OK</em>, we placed the SPICE command &#8220;.op&#8221; at the bottom of the schematic, in the same way that one places components.  The final step to running a simulation is to click on the <em>Run</em> button, highlighted in this image.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/run.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
<p>A window opens with the results of the DC simulation. In this simple case, we see that the voltage supply is 9 volts, as we specified.  In addition, the current is computed for the voltage supply and the resistor.  As Ohm&#8217;s law requires, the current through the resistor is <em>9/1K = 0.009</em> amperes, or <em>9mA</em>.</p>
<p align="center"><img src="http://gaussmarkov.net/tools/LTspice/simulation.PNG" title="LTSpice ground component" alt="LTSpice ground component" /></p>
]]></content:encoded>
			<wfw:commentRss>http://gaussmarkov.net/wordpress/tools/software/ltspice/an-ltspice-tutorial/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
