• Solutions
    • Power Supplies
    • Motor Drives
    • Microgrids & Grid Connected
    • Storage & Generation
    • Multi-Level Converters
    • Non-Ideal Devices
  • Products
    • PSIM
    • DSIM
    • SmartCtrl Pro
    • Hardware
  • Resources & Support
    • Knowledge Base
    • Tutorials
    • Webinars
    • Power Electronics Blog
    • PSIM User Forum
    • More Resources
    • Request Support
  • Academia
    • For Students
    • For Instructors
    • Educational Pricing
    • Sponsorships
  • About Powersim
    • News & Events
    • Partnerships
    • Careers
    • Contact Us
< Resources & Support < Tutorials

AC Analysis of Switchmode Circuits in SPICE Simulation

TAGS: SPICE PSIM

View this page as PDF

 

Overview

AC analysis is an important tool in circuit analysis and design. By default, SPICE-based software cannot perform ac analysis if a circuit is in switchmode. It can only perform the analysis if the switchmode circuit is replaced by its equivalent average model. Deriving the average model, however, is a non-trivial task.

One way of performing ac analysis of a switchmode circuit is to perform multiple simulation runs in the time domain. This becomes possible with the increasing computational power of computers.
However, it is cumbersome and tedious to set up multiple simulation runs, perform postprocessing, and obtain ac analysis results by oneself.

PSIM provides the capability to perform ac analysis of switchmode circuits in LTspice simulation. It is very easy to set up the circuit, and both open-loop and closed-loop frequency responses can be
easily performed.

This tutorial describes how to use this function through an example.

 

Setting up the Circuit

In this tutorial, we will use a buck converter example to illustrate the process. In PSIM, go to the File menu and select Open examples…. Then go to the “dc-dc” folder and open the file “buck.psimsch”. This file contains two-buck converter circuits: one controlled by a Gating Block, and another by a comparator which compares a dc voltage with a triangular wave.

Copy the buck converter controlled by the comparator to a new schematic file. Save the file as “Buck Converter FRA1.psimsch”.

In order to better illustrate the ac analysis, the circuit is slightly modified as shown below.

 

Changes to the circuit are:

  • A small resistor is inserted in series with the inductor to add damping to the LC filter.
  • The capacitance is reduced to 47uF to increase the resonant frequency of the LC filter.
  • The switching frequency is increased from 5kHz to 50kHz. This will increase the
    frequency display range of the Bode plot.

AC analysis of a circuit should be carried out in the steady-state. To prepare ac analysis, run a transient simulation of the circuit until it reaches the steady state. In this example, with the duty cycle of 0.6, the steady-state is reached around t0=0.003 sec.

For a single ac sweep output, from the PSIM menu, select Elements >> SPICE >> AC Sweep (1 probe) and place it in the circuit. This element contains an ac perturbation source and a probe to measure the response.

Enter the parameters of the ac sweep block. In the example, the perturbation source peak amplitude is set to 0.2, and the dc offset that establishes the circuit operating point is set to 0.6.

Then define the names of the nodes. The names of the node must be defined as ACS at the source side, and ACR at the response side. The node names can be set by selecting Edit >> Set Node Name.

The circuit is shown below:

 

 

Setting up Simulation Control

In “Simulation Control”, go to the SPICE tab, and define the parameters as below:

Please note:

  • Parameters in the “Step Run Option” section determine the frequency range and the Bode plot’s resolution. Note that the end frequency should be lower than half of the switching frequency. In the example, the start frequency is 200Hz, and the end frequency is 20KHz, with 10 points per decade.
  • In the “Parameters” section, “Start Time” is the steady-state time t0 as determined earlier. “End Time” determines how many cycles are used to calculate the frequency response. It can be as low as 1 or 2 cycles. But 5 to 10 cycles are recommended. In the example, we choose 10 cycles, and the end time is the start time plus 10 times the period of 1/Freq.
  • In the “Analysis” section, choose Transient for transient analysis.

 

 

Running Simulation

Click on the Lt button in the Toolbar or select Simulate >> Run LTspice Simulation to run the simulation.

After the simulation is completed, SIMVIEW will display the Bode plot as shown below.

SIMVIEW can also display the time-domain waveforms of the voltages at the nodes ACS and ACR, as well as other voltages and currents as defined by the voltage probes and current flags.

 

 

Running AC Sweep with Two Output Probes

In many cases, a circuit may have two control loops – for example, a voltage loop and a current loop. Or one may wish to run ac analysis with two outputs in the same circuit, as shown in the
circuit below.

 

The ac sweep block has one ac perturbation source and two output probes.

From the PSIM menu, select Elements >> SPICE >> AC Sweep (2 probes), and place the element in the circuit. Name the nodes as ACS at the source side and ACR1 and ACR2 at the response side.

Connect the nodes to the rest of the circuit. For the current response, a current sensor can be used to convert the current signal into a voltage signal.

Run LTspice simulation and view result in SIMVIEW.

 

Measuring the Frequency Response of a Closed Loop

To measure the frequency response of a closed control loop, use the AC Sweep (loop) block.

From the PSIM menu, select Elements >> SPICE >> AC Sweep (loop) and place it in the schematic, as shown in the example below.

Name the nodes as ACS at the source side and ACR at the response side.

Enter the parameters for the ac sweep block. In the example, the perturbation source peak amplitude is 0.01V.

Run LTspice simulation and view results in SIMVIEW.

 

  • Knowledge Base
  • Tutorials
  • Webinars
  • Application Notes
  • Power Electronics Blog
  • More Resources
  • Request Support
Browse by Tag
  • Digital Control
  • Thermal
  • Power Supply Design Suite
  • PSIM
  • DSIM
  • Power Converter
  • SmartCtrl
  • Simulink
  • EV/ HEV
  • Analog Control
  • Motor Drive
  • Solutions
  • Power Supplies
  • Motor Drives
  • Microgrids & Grid Connected
  • Storage & Generation
  • Multi-Level Converters
  • Non-Ideal Devices
  • Products
  • PSIM
  • DSIM
  • SmartCtrl Pro
  • Hardware
  • Resources & Support
  • Videos & Tutorials
  • Webinars
  • PSIM User Forum
  • Request Support
  • PSIM Version History
  • Academia
  • For Students
  • For Instructors
  • Educational Pricing
  • Sponsorships
  • About Powersim
  • News & Events
  • Testimonials
  • Partnerships
  • Careers
  • Contact Us
© 2023 Powersim, Inc Privacy Policy