title: Tutorial 105: Analysis Tools¶
Tutorial 105: Analysis Tools¶
Overview¶
Learn to use GeckoCIRCUITS analysis tools for steady-state analysis, frequency response (Bode plots), and small-signal characterization of power converters.
Level: Intermediate (⅔)
Duration: 40-50 minutes
Series: Getting Started
Status: Placeholder - Features may vary by GeckoCIRCUITS version
Learning Objectives¶
By the end of this tutorial, you will: - [ ] Perform steady-state (periodic) analysis - [ ] Generate Bode plots for control loop design - [ ] Measure transfer functions (input-to-output, control-to-output) - [ ] Analyze stability margins (gain margin, phase margin)
Prerequisites¶
- Complete Tutorial 104: Running Simulations
- Understanding of frequency response concepts
- Basic control theory knowledge
Analysis Types¶
1. Transient Analysis (Standard)¶
- Time-domain simulation
- Shows startup, transients, and steady-state
- Most common analysis type
2. Steady-State Analysis¶
- Finds periodic operating point directly
- Skips startup transient
- Faster for efficiency calculations
3. AC (Small-Signal) Analysis¶
- Linearizes circuit around operating point
- Generates frequency response (Bode plots)
- Essential for control loop design
Steady-State Analysis¶
Purpose¶
Find the periodic steady-state without simulating startup: - Efficiency calculations at operating point - Waveform analysis without transients - Faster than long transient simulation
Procedure¶
- Setup: Define fundamental frequency (switching frequency or line frequency)
- Run: Solver iterates to find periodic solution
- Verify: Check that waveforms repeat exactly each period
Example: Buck Converter Efficiency¶
- Build buck converter circuit
- Enable steady-state analysis
- Measure: Pin, Pout, losses
- Calculate: η = Pout / Pin
AC (Frequency Response) Analysis¶
Theory¶
Linearize non-linear switching converter around operating point:
┌─────────────────────┐
d̂ ──►│ Converter │──► v̂out
│ (linearized model) │
└─────────────────────┘
Transfer function: Gvd(s) = v̂out(s) / d̂(s)
Key Transfer Functions¶
| Transfer Function | Symbol | Description |
|---|---|---|
| Control-to-output | Gvd(s) | Duty cycle to output voltage |
| Line-to-output | Gvg(s) | Input voltage to output voltage |
| Input impedance | Zin(s) | Small-signal input impedance |
| Output impedance | Zout(s) | Small-signal output impedance |
| Loop gain | T(s) | Open-loop transfer function |
Bode Plot Interpretation¶
Gain (dB) Phase (deg)
│ │ 0°
40 ┤ ├─────────────────
│ ──────┐ │ ╲
20 ┤ │ │ ╲
│ ╲ │ ╲
0 ┤ ╲───── ├────────────╲────
│ │ -180° ╲
-20 ┤ │ ╲
└────────────────── f └──────────────── f
fc (crossover) PM (phase margin)
Stability Margins¶
| Margin | Definition | Typical Target |
|---|---|---|
| Gain Margin (GM) | Gain at -180° phase | > 10 dB |
| Phase Margin (PM) | Phase at 0 dB gain | > 45° |
| Crossover Frequency (fc) | Frequency where gain = 0 dB | fs/5 to fs/10 |
Analysis Workflow¶
Step 1: Establish Operating Point¶
- Run transient simulation to steady state
- Or use steady-state analysis directly
- Record DC values: Vout, IL, D
Step 2: Inject Small-Signal Perturbation¶
- Add small AC component to control signal
- Frequency: sweep from low to high (e.g., 10 Hz to fs/2)
- Amplitude: small enough for linear response (1-5%)
Step 3: Measure Response¶
- Record output AC magnitude and phase
- At each frequency, calculate:
- Gain: |Vout_ac| / |d_ac|
- Phase: ∠Vout - ∠d
Step 4: Plot Results¶
- Magnitude in dB: 20×log10(|G|)
- Phase in degrees
- Identify: crossover, margins, resonances
Buck Converter Example¶
Open-Loop Transfer Function¶
Control-to-output for buck:
Characteristic: - DC gain: Vin - LC resonance: fr = 1/(2π√LC) - ESR zero: fz = 1/(2π×RC×C)
Closed-Loop Design¶
- Measure open-loop Gvd: Run AC analysis
- Design compensator: PI, Type II, or Type III
- Verify loop gain T(s): Gc × Gvd × H
- Check margins: PM > 45°, GM > 10 dB
Exercises¶
Exercise 1: Steady-State Efficiency¶
- Build 48V→12V buck converter
- Run steady-state analysis at full load
- Calculate efficiency from average powers
Exercise 2: Open-Loop Bode Plot¶
- Use the buck converter from Exercise 1
- Perform AC analysis (no feedback)
- Identify: DC gain, resonance frequency, phase
Exercise 3: Loop Gain with PI Controller¶
- Add PI compensator to the buck
- Measure loop gain T(s) = Gc × Gvd
- Determine phase margin and crossover frequency
Exercise 4: Design for 45° Phase Margin¶
- Adjust PI gains to achieve PM = 45°
- Verify with Bode plot
- Test step response in time domain
Manual AC Analysis Method¶
If automated AC analysis is not available:
Frequency Sweep Procedure¶
- Set up transient simulation
- Add sinusoidal perturbation to duty cycle:
- Run simulation for several cycles at frequency f
- Measure output amplitude and phase
- Repeat for multiple frequencies (log spacing)
- Plot magnitude and phase vs. frequency
MATLAB Post-Processing¶
% Load exported data
data = readmatrix('sweep_results.csv');
f = data(:,1);
gain_dB = data(:,2);
phase_deg = data(:,3);
% Bode plot
figure;
subplot(2,1,1);
semilogx(f, gain_dB);
ylabel('Gain (dB)');
grid on;
subplot(2,1,2);
semilogx(f, phase_deg);
ylabel('Phase (deg)');
xlabel('Frequency (Hz)');
grid on;
Common Issues¶
| Issue | Cause | Solution |
|---|---|---|
| Noisy Bode plot | Perturbation too small | Increase AC amplitude |
| Non-linear response | Perturbation too large | Decrease AC amplitude |
| Aliasing at high freq | Not enough samples | Reduce time step |
| Can't find steady state | Circuit doesn't converge | Check for stability |
Related Tutorials¶
- 104 - Running Simulations - Basic simulation setup
- 201 - Buck Converter - Test circuit
- 702 - MATLAB Integration - Data export/analysis
References¶
- Erickson & Maksimovic, Chapter 8: "Converter Transfer Functions"
- Basso, C. "Switch-Mode Power Supply SPICE Cookbook"
- Venable, D. "The K Factor: A New Mathematical Tool for Stability Analysis"
Circuit Files¶
Status: Placeholder -
buck_ac_analysis.ipes- Buck for frequency analysis -boost_loop_gain.ipes- Boost with compensator -frequency_sweep.ipes- Manual sweep setup
Tutorial Version: 1.0 (Placeholder) Last updated: 2026-02 Compatible with GeckoCIRCUITS v1.0+