Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide

One of the more challenging aspects of Switching Mode Power Supply (SMPS) design can be the simulation of the combined analog and digital functions included in a SMPS. Linear Technology has made this aspect of SMPS design much easier by providing a free, powerful, easy to use and very fast version of the popular analog simulation program, SPICE. LTspice IV is a fourth generation switching regulator design program from Linear Technology. The program consists of a high performance SPICE simulator extended with a mixed mode simulation capability that includes new intrinsic SPICE devices for macro-modeling Switch Mode Power Supply (SMPS) controllers and regulators. The program includes an integrated hierarchical schematic capture program that allows users to edit example SMPS circuits or design new circuits. An integrated waveform viewer displays the simulated waveforms and allows further analysis of the simulation data. There is a large built-in database for most of Linear Technology’s power ICs and many passive components. The device database, schematic editing, simulation control and waveform analysis are integrated into one program. This application note provides a quick introduction to the use of LTspice in the design of a simple Switch Mode Power Supply. It gives a step-by-step guide to downloading, installing and using LTspice so the interested user can quickly and easily become familiar enough with the program to use it on their own design. Topics in this application note are organized by task (Download/Install, Schematic Capture and Simulation) and each topic is a stand-alone section, with a short introduction or overview, followed by the stepby-step guidelines. The reader may skip over sections and go directly to the topic of interest, or start at the beginning and follow each topic in order to quickly go through the entire design process, step-bystep. Details that may be of interest to only a sub-set of readers are included as side-bars which can be read or skipped as required to make it easy to get just the information needed by the reader. The topics covered in this application note include the following: 1) Introduction 2) LTspice Overview a. The Need for LTspice b. Download and Install c. Included Resources i. Linear Technology Devices ii. Educational Examples 3) Schematic Capture a. Using existing examples b. Creating your own design 4) Simulation a. Running Your First Design: Step-by-Step b. Observe Results i. Probes ii. Transient Response Linear Technology has several resources available for the reader interested in more details. These resources are listed in the Reference Section at the end of this app note. AN012 September 2009 (Version 1.0) AN012 September 2009 (Version 1.0)

LTspice Overview
LTspice was created by Linear Technology as a way to make it easy for Switching Mode Power Supply Designers, and designers of similar analog/digital subsystems, to quickly and easily simulate their designs. Older versions of SPICE were too cumbersome and inefficient when used for these types of design. (Refer to the accompanying sidebar for more details). Because of its focus on SMPS types of sub-modules LTspice has many advantages over other versions. Most importantly it executes fast enough enough to be interactive. (Refer to the side bar on the next page for a summary of LTspice features and benefits). LTspice includes a wide variety of pre-built designs that makes it easy to start using LTspice right away. There are currently approximately fifteen hundred Linear Technology products modeled in LTspice. Also included are demonstration files that allow you to watch step-load response, start-up and transient behavior on a cycle-by-cycle basis. Despite LTspice’s close association with SMPS design, it not a SMPS specific SPICE but simply a SPICE program fast enough to simulate a SMPS interactively. The improved performance of the SPICE simulation engine is a benefit for simulating general analog circuits and should be of interest to all electronic engineers. With an installed base of over 2,000,000 licenses so far, LTspice has become the de facto standard SPICE simulator. A simple example of the use of LTspice is shown in Figure 1 on the next page. The balance of this section of the app note will go over the process of downloading and installing LTspice. If you have already downloaded and installed LTspice you can skip the following stepby-step guide and go to the next section on Schematic Entry. Download and Install LTspice is as easy to download and install as it is to use. Simply navigate to the LTspice landing page at: and click on the Download LTspice link. A download page will open. If you have not already registered for a MyLinear account now is a good time to do this. Simply click on the Register for a new MyLinear account link and follow the registration instructions. Return to the landing page once you are finished registering. Once you click on the download link a file download window will open. Click Save and save the file to your desktop. It will be saved as a Windows .EXE file and can be installed after it has been downloaded. Double click on the .EXE file to install LTspice. Follow the install directions and after the install is complete the program should open. Once the program is open you are ready to move to the next section of the app note where we will introduce the Schematic Capture capabilities of LTspice.

Figure 1: LTspice Example Showing Transient Response for a Simple Switching Power Supply Circuit AN012 September 2009 (Version 1. A user can get a detailed simulation of power systems with a few mouse clicks without knowing anything about the device. the simulation speed is greatly improved while simulation accuracy is retained. It is easier in many cases to simulate rather than breadboard. like the board level component the model. There have been analog circuit simulation methods that have shown some success in speeding up switch mode power supply simulation but at a cost of making simplifying assumptions which don’t allow arbitrary control logic and fully simulate the complexity of the switching waveforms. A new SPICE with integrated logic primitives that perform the switch mode control provides a better answer. Another benefit is that convergence problems are easier to avoid since they. A simulation circuit element was developed for power MOSFET’s that accurately exhibits their usual gate charge behavior without using sub-circuits or internal nodes. have finite impedance at all frequencies. Switch-mode power supplies have fast high frequency switching square waves as well as slow overall loop response.Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide The Need for LTspice Analog circuit simulation has been inseparable from analog IC design. The success of these analog circuit simulators has made circuit simulation spread to board level circuit design. Commercially available SPICE’s simply take too long for this to be a useful simulation method. Incorporated into the new SPICE are circuit elements to model practical board level components. yield detailed waveforms. the SPICE simulation allows measurements of currents and voltages that are virtually impossible to do any other way. Modern switch mode power supplies include controller logic with multiple modes of operation.0) . Due to the mixed mode simulation capability and many other enhancements over previous SPICE programs. Further. Certain analog functions are extremely difficult to simulate with commercially available SPICE simulators. LTspice Features and Capabilities LTspice is a new SPICE that was developed to simulate analog circuits fast enough to make simulation of complex SMPS systems interactive. Reducing the number of nodes the simulator needs to solve significantly reduces the computation required for a given simulation without compromising the accuracy or detail of the switching waveforms. SPICE or the schematic capture program. SPICE simulators are the only way to check circuitry prior to integration onto a chip. devices may change from pulse switch modulation to burst-mode or to cycle skipping depending on the circuit’s operation. This means simulations must run for thousands to hundreds of thousands of cycles in order to see the overall response of a switching regulator. and the ability to analyze the circuit in the simulation for performance and problems speeds the design of well-understood. An original new mixed-mode compiler and simulator were written into LTspice that allows these products to be realistically modeled in a computationally fast manner. For example. robust circuits. It can give fast simulation times. and still allows the flexibility for arbitrary circuit modifications. Simulation times for a switch-mode power supply must be in minutes not hours for a simulator to be useful. Pre-drafted demo circuits can be used as a starting point to build the custom circuit to fit different power supply requirements. Capacitors and inductors can be modeled with series resistance and other parasitic aspects of their behavior without using sub-circuits or internal nodes. Detailed cycle-by-cycle SMPS simulations can be performed and analyzed in minutes.

rotate. The easiest way to use the LTspice Schematic Capture system is to modify an example circuit provided by Linear Technology. drag. like the one shown in Figure 3 will open. In the remainder of this section we will give a step-by-step guide to creating a simple schematic as a way to demonstrate how easy it is to get started with LTspice. drag or delete command.0) . when you wish to move. The program will stay in the move. In a previous app note on using LTC Switching Power Supply modules with Xilinx Virtex-5 FPGAs we discussed the LTC4601 (see the Reference Section for a link to that app note). A dialog box. The User Guide included with LTspice has a wealth of details on the various commands used with the Schematic Editor so these will not be repeated here. drag or delete objects. Then you can select an object by clicking on it. You can select multiple objects by dragging a box about them. or delete mode until the right mouse button is clicked or the Esc key is pressed. Simply open the program and follow along as described. In the Look-in pull down menu at the top of the box select jigs. first select the move. comparators and many other general purpose devices. mirror.not to select it for an editing command. Figure 2: LTspice Starting Window AN012 September 2009 (Version 1. We will pull up the test jig included in LTspice for the LTC4601 to see how we might use the Schematic Capture tools to modify the schematic. Select the 4601. LTspice Program Note: Because LTspice is primarily a simulation tool the default action when an element is selected is to plot the voltage on it or the current through it. the default behavior is to plot the voltage on that wire or current through that component. The user should select the editing command first (to override the simulation default). To load an existing jig simply click on the File command in the upper left of the LTspice window.Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Schematic Capture with LTspice LTspice has a built-in Schematic Capture program that can be used to create target design for simulation. From this window you can create your own schematic. Opening and Editing a Schematic When you invoke LTspice IV you will get the start-up window shown in Figure 2 below. This should become clear during the following editing examples. You can even draw your own symbols for devices you wish to import into the program. Refer to the Reference Section at the end of this app note for the web address for the LTspice User Guide. Unlike many schematic capture programs. This means that if you click on an object. Then type in the first few digits of the part number you are interested in (4601 in this case) and you will end up with a set of options you can select from. There are over 1500 symbols included within LTspice and they cover most of the LTC power ICs. not select the object for editing or some other editing behavior which would then invalidate the simulation just performed. In our example we will load one of the many schematics provided by LTC for an existing product. A design from a different Schematic Capture program can be read-in or a complete design created with-in LTspice. this one was written explicitly for running SPICE simulations. as done in Figure 3 and click Open. op amps. All schematic edits can be undone or redone. import a complete schematic or bring in an existing schematic as a starting point. Hence.

Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Simple Editing Commands Some of the basic editing commands are given below along with the step by step descriptions of how to do them using the example design from Figure 4.each segment is considered a separate element. You can position the scissors on a wire or component and then click on it. Delete a Wire or a Circuit Element Select the delete command with a click on Edit and then on the pull down menu click on Delete.0) . To get the elements deleted back. The resistor will be deleted. Simply follow along and make the changes described under each command and you will be able to begin modifying the jig most appropriate for your specific application. The wire will be deleted. Then we will move to the Simulation Section of the app note. When you click a wire will start. but more on that in the next section). Do this twice and the jig will be returned to its original state. Add a Wire To add a wire click on the Edit command and then click on the Draw Wire command.tran 750u startup is the simulation command that will be used. The wire or element will be deleted. This jig is set-up to evaluate the start-up transient for the power supply based on the input voltage V1 in the upper left corner as annotated by the text in the lower right corner (. As you move the cursor around the wire will follow on each click. simply select the Edit command and then Undo. As an example position the cursor over the wire above R3 on the top left of the diagram (the wire going to Vin) and click on it. The cursor will turn into a cross-hair. Figure 4: LTM4601 Jig Schematic AN012 September 2009 (Version 1. The cursor will now show as a scissors icon. Let’s review a few simple Schematic Editing commands to see how easy it is to make modifications to the existing design. Press the esc key to stop the Draw Wire Figure 3: Add Schematic Dialog Window The selected schematic will fill the included schematic shown in Figure 4 below. Now position the cursor over R3 and click on it. Notice only a segment of the wire is deleted.

Select Edit. Experiment with the Draw Wire command by connecting the PLLIN terminal to the Vin wire. Once you have finished exploring the Draw Wire command use the Undo command to return the jig to its original state. When you click the component will be added to the schematic.Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide command. capacitors. Just click on the component you want to add and the cursor will take on the shape of the selected component.5V and 0. but you pick the type of element to add from the Edit menu. AN012 September 2009 (Version 1.070 Ohm R. Try this with a capacitor.for example the KEMET 100 uF Tantalum 2.0) . The added capacitor will now be connected into the circuit. etc.and then click on the OK button. Figure 5: Selecting a Capacitor Summary The above commands should be enough to allow you to create your own simple schematics. Modify Element Characteristics Now you need to edit the capacitor characteristics. If you put a component next to a terminal or wire connection the component will be automatically connected to the the next section. Don’t forget to look over the supplied jigs and educational circuits. Notice that if you click on a terminal or another wire a connection will be made to the wire being drawn. First click on Edit and you will see selections for various components. Add Capacitor and then place the capacitor just below the wire connection to R4 on the left hand side of the schematic. Now let’s move on to the main use of LTspice. Once the capacitor is placed. Review the other commands in the Edit pull down window and try them out. diodes. you can scroll down to the capacitor you want.Simulation. One of the easiest ways to do this is to select the capacitor type from the included component database. press the esc key to end the Add Capacitor command. Just click on the Select Capacitor button and the database will come up. The capacitor will now show the key characteristics on the schematic (110u and the Tantalum symbol of an arc for the lower capacitor line).resistors. Right click on the capacitor icon (when the cursor shows as the pointing hand) and a dialog box will come up so you can change the element characteristics. In most cases the majority of your work has been done already. In a few minutes you should be able to create any schematic you need. The cursor will keep the component shape so you can add as many copies as you like. Add a Circuit Element Adding a circuit element in LTspice is similar to adding a just need to make changes. As shown in Figure 5.

The cursor will change to a probe icon when it is positioned over a node where the voltage can be measured. Running and Displaying Simulation Results Use the included schematic for the 4601 by opening it up as described in the previous section. For our example. Figure 6: Simulation results for Vin and Vout in the Example Circuit AN012 September 2009 (Version 1. Click on the schematic window to make sure it is active. The Transient Analysis tab has data entered so it is the active command. This allows the user to efficiently experiment with various settings and designs if you try something and it doesn’t respond how you expect it you have not wasted much time and can quickly make changes. Click on the Simulate pulldown menu and you will see a set of commands. In the following sections we will cover running simulations. Use the cursor and place it near the wire connected to the Vin signal on the upper right of the LTM4601 symbol. When simulation is completed (after 720us in this example) we can select the points on the schematic to display in the upper window. The simulation will run and tracks progress in the status line at the bottom of the window. You should have a display similar to the one shown in Figure 6. displaying simulation results and then quickly describe the variety of simulations supported by LTspice. Click on Run and the simulation commands associated with the schematic will be executed. In this case the simulation commands are for transient analysis (as indicated by the text displayed on the schematic. let’s look at the output voltage and the input voltage to see how the output varies based on the input voltage ramp-up.the one we are interested in is Run. Many of the features of the tool will need to be left for the reader to explore on their own. Click on the selected node and the voltage will be displayed in the simulation window.right click on the schematic capture window and click on the edit simulation cmd button to see the details. but the balance of this section should provide the reader with the necessary basic concepts to make this possible. below. We will cover all the key commands later in this section). Do the same on the Vout signal to display it in the window as well. This iterative design approach also makes it easy to learn the tool a step at a time. Simulation with LTspice is interactive and very fast.0) .Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Simulation with LTspice Once the schematic has been created it is easy to simulate the design using LTspice.

On the example circuit position the probe over the capacitor between the Vosns+ and Vosns. Select the Zoom Area command and then select the beginning of the display (from 0us to 160us) by clicking on the upper left of the display and then at the top of the 160us point in the display. You should see a display similar to that shown in Figure 7 below. The current across the capacitor is displayed in the upper window.0) . Figure 7: Zoomed Display of Current thru C2 You can easily edit the signals displayed in the upper window. Just position the cursor over a component and tit turns into a current measuring probe.Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Measuring current is easy as well. The cursor will switch to the pointing hand icon when you are positioned correctly. The cursor icon switched to a ruler. AN012 September 2009 (Version 1. Notice that the signal is switching so fast it is difficult to see easily.signals and click. You can change display characteristics or delete the signal by clicking on the Delete This Trace button. You can zoom-in on the signal to see it better by positioning the cursor on the bottom axis label. Right click and you will get a menu of commands. If you delete I(C2) and then change the display via the Zoom to Fit command (by Right Clicking on the bottom axis label and selecting Zoom to Fit) you should get back to the display shown in Figure 6. The display will zoom to the section selected. Click on the upper window and then position the cursor over the signal label at the top of the window. Right click to bring up the edit window for the signal.

0) .wav audio files so you can listen to the results. Finally. Step This command causes an analysis to be repeatedly performed while stepping the temperature. DC Transfer Analysis This is an analysis mode that finds the DC small signal transfer function of a node voltage or branch current due to small variations of an independent source. a model parameter. Test signals are often applied as independent sources. and noise considerations. stability analyses. This is useful for associating a name with a value for the sake of clarity and parameterized sub-circuits so that abstract circuits can be saved in libraries. Control Panel The LTspice control panel allows you to customize many of the aspects of LTspice. The results will appear in a dialog box.op if you wish only this operating point to be found. Such libraries would be supplied by a third party. shot and flicker noise. Figure 8: LTspice Simulation Commands Transient Analysis Perform a transient analysis. The command can be displayed on the Schematic Capture window by placing the cursor (which shows a text placement icon after the Simulation Command window closes) on the schematic and then clicking to locate the text ( if it is a change to an existing command the current text is just changed. It is useful for computing the DC transfer function of an amplifier or plotting the characteristic curves of a transistor for model verification. networks. the resultant linearized circuit is solved in the frequency domain over the specified range of frequencies.Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Overview of Simulation Commands There are a variety of powerful simulation commands available in LTspice. Some Additional LTspice Commands LTspice has a full range of other commands and options. We can only provide an overview in this app note but a much more detailed description can be found in the User Guide listed in the Reference Section of this document. This is a big help with audio processing circuits. You will see a list similar to that shown in Figure 9. After an OP simulation. Each tab is a different command and the commands can be enabled by selecting the tab and entering the desired command parameters via check boxes or value boxes. Once the command is entered clicking OK will store the command. Click on the Tools menu and select Control Panel from the pull down menu. logarithmic. linearized small signal models for all of the nonlinear devices in the circuit are found for this operating point. using independent voltage and current sources as the driving signal. The output data is noise spectral density per unit square root bandwidth. Param The param directive allows the creation of user defined variables. If you right click on the Schematic Capture window and select Edit Simulation Cmds the Simulation Command window. Wave LTspice can convert waveform outputs to . when you point at a node or current the OP solution will appear on the status bar. DC Analysis This performs a DC analysis while sweeping the DC value of a source. A couple of the most interesting ones include: Encrypted Libraries LTspice supports the use of Vendor Encrypted Libraries to protect sensitive design information. Use . comes up. A large number of standard arithmetic and logic functions are available to create very powerful expressions. Noise Analysis This is a frequency domain analysis that computes the noise due to Johnson. Usually a DC solution is performed as part of another analysis in order to find the operating point of the circuit. with the position retained). or specified as a list of values. It basically computes what happens when the circuit is powered up. This mode of analysis is useful for filters. First. Next. the DC operating point of the circuit is found. Measure This command is used to find values from simulation results so they can be saved for further analysis or as a record of key results. as seen in Figure 8 below. AC Analysis The small signal (linear) AC portion of LTspice computes the AC complex node voltages as a function of frequency. DC Operating Point Perform a DC solution with capacitances open circuited and inductances short circuited. Steps may be linear. This is the most direct simulation of a circuit. or an independent source. a global parameter. AN012 September 2009 (Version 1.

It demonstrated how to download.asp?id=14 5) LTC Demo Circuits . consequential. or standard. For the reader who wants additional levels of detail on the Linear Technology products used in this app note a list of valuable documents is given in the Reference section at the end of this document. In no event will Nu Horizons be liable for any loss of data.nuhorizons.http://www.linear.pdf 3) LTspice Getting Started Guide . or fitness for a particular purpose. and is subject to change without further notice from Nu Horizons.http://www. application. without limitation. This Application Note is one possible implementation of this feature.linear. AN012 September 2009 (Version 1. whether express or 2) LTspice User Guide . Figure 9: Control Panel for LTspice Conclusion This application note has provided a step-by-step guide to LTspice. You can experiment with various settings and then restore the defaults by clicking on the Reset to Default Values if you need to recover the initial settings. References 1) LTspice Landing Page .jsp Notice Of Disclaimer Nu Horizons is disclosing this Application Note to you “AS-IS” with no warranty of any kind. You are responsible for obtaining any rights you may require in connection with your use or implementation of this Application Note.http://www. Nu Horizons makes no representations or warranties. use the schematic editor and run simple lost profits.http://ltspice. incidental.0) . This should provide you with enough background to make it easy to use LTspice to simulate your own Switching Mode Power Supply or any of a host of circuits using Linear Technology products. install. implied warranties of merchantability.linear. statutory or We have only been able to cover a few of them in this app note but it should give you an appreciation for the power of this easy to use 4) Powering a Virtex-5 FPGA with LTC Power Devices App Note .Using Linear Technology’s LTspice IV for Switching Mode Power Supply Simulation: A Step-By-Step Guide Click on the tab to access the desired group of settings.http://www. Summary LTspice has many powerful commands and options. or indirect damages arising from your use of this application note. noninfringement. or for any special.

Sign up to vote on this title
UsefulNot useful