Re: PWM Amp Design




Chris Carlen wrote:

> [For] academic purposes I am still curious about what other
> approaches other than an equalizing network one might try to solve
> the reactance problem? It seems to me that one approach might be
> to try to sense the PWM output post-filter, and then compensate
> for the peaking within the PWM amplifier control loop.

At the end of this post is an LTspice schematic files that is an
example of a large signal frequency response analysis of a class d
amplifier.

This simulation uses the recently derived* mathematically correct
swept sine time domain source in conjunction with a very fast
running LTspice A-device to analyze the large signal behavior of a
self oscillating class d amplifier under a variety of dc bias levels
(approximates high frequencies riding on a large bass signal). The
sine source is swept logarithmically from 2.5kHz to 250kHz (25kHz is
center screen).

Many weird large signal effects (such as frequency shift, aliasing,
pulling and lock) are clearly visible. Note that none of these
would be evident in a small signal ac analysis.

When properly set up, the A-device simulates a realistic delay while
efficiently allowing maximum step size between switching edges and
simultaneously capturing edge timing with great fidelity. This makes
successive design iterations possible with almost no waiting. :)

Regards -- analog

*Earlier (in the LTspice Yahoo Group) I was trying to generate a
logarithmically swept sine source that would produce the equivalent
of a small signal linearized frequency-based ac analysis in a time
domain-based transient analysis. My intuition had led me to expect
that given a slow enough sweep, the "doppler effect" on the swept
sine wave should have been small enough to ignore.

The sort of .tran swept sine source I was seeking would allow direct
frequency response analysis of such non linear circuits as switching
power supplies or class D amplifiers without having to replace them
with "equivalent" linear models.

I am fortunate enough to have a good personal friend (known as "The
Phantom" on sci.electronics.design, etc.) who is both an excellent
analog engineer and a wizard with Mathmatica. With his assistance
I now have an exact expression for a logarithmically swept sine wave
source in the time domain. This technique makes a *very* nice
addition to LTspice's burgeoning tool set.

Here are the basic equations:

The sine wave: V(t) = Vp*sin(2*pi*f*t); f normally constant

The sweep function: f(t) = f1*(f2/f1)**(t/dt); where
f1 is the start frequency
f2 is the stop frequency
dt is the sweep duration

As noted, simply combining the two equations squeezes the
resulting sine wave, leading to frequency "compression".

V(t) = Vp*sin(2*pi*f1*(f2/f1)**(t/dt)*t); WRONG!!

Here is the correct form:

V(t) = Vp*sin(2*pi*f1*(f2/f1)**(t/dt)*dt/ln(f2/f1)); mmm..good

~~~~ UcD_swept_sine_test.asc (cut&paste & mind the word wrap) ~~~~
Version 4
*** 1 1324 680
WIRE 64 16 64 -64
WIRE 64 128 64 96
WIRE 64 256 64 224
WIRE 64 368 64 336
WIRE 96 -64 64 -64
WIRE 96 224 64 224
WIRE 112 -64 96 -64
WIRE 112 224 96 224
WIRE 224 -64 192 -64
WIRE 224 -64 224 -160
WIRE 240 -160 224 -160
WIRE 256 -64 224 -64
WIRE 256 16 256 -64
WIRE 256 32 256 16
WIRE 256 128 256 96
WIRE 288 -64 256 -64
WIRE 336 -160 320 -160
WIRE 368 16 256 16
WIRE 416 -160 400 -160
WIRE 416 -64 368 -64
WIRE 416 -64 416 -160
WIRE 480 16 432 16
WIRE 544 16 480 16
WIRE 656 16 624 16
WIRE 656 32 656 16
WIRE 656 128 656 96
WIRE 704 16 656 16
WIRE 752 -64 416 -64
WIRE 752 16 704 16
WIRE 752 16 752 -64
WIRE 752 32 752 16
WIRE 752 128 752 112
FLAG 96 -64 i
FLAG 96 224 f
FLAG 64 368 0
FLAG 64 128 0
FLAG 656 128 0
FLAG 752 128 0
FLAG 480 16 x
FLAG 704 16 o
FLAG 256 128 0
SYMBOL bv 64 240 R0
WINDOW 3 -24 168 Left 0
SYMATTR Value V=f1*{f2/f1}**(time/Td)
SYMATTR InstName Bf
SYMBOL bv 64 0 R0
WINDOW 3 -24 168 Left 0
WINDOW 123 -66 214 Left 0
SYMATTR Value V=Vdc+Vp*sin({2*pi*Td/ln(f2/f1)*f1}*{f2/f1}**(time/Td))
SYMATTR InstName Bi
SYMBOL ind 528 32 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 5 56 VBottom 0
SYMATTR InstName Lo
SYMATTR Value 30µ
SYMATTR SpiceLine Rser=10m Rpar=10k
SYMBOL cap 640 32 R0
SYMATTR InstName Co
SYMATTR Value 680n
SYMBOL res 736 16 R0
SYMATTR InstName Ro
SYMATTR Value 6
SYMBOL res 208 -80 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R2
SYMATTR Value 1k8
SYMBOL res 384 -80 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R1
SYMATTR Value 8k2
SYMBOL res 336 -176 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R3
SYMATTR Value 1k0
SYMBOL cap 400 -176 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C1
SYMATTR Value 150p
SYMBOL cap 240 32 R0
SYMATTR InstName C2
SYMATTR Value 33p
SYMBOL Digital\\inv 368 -48 R0
WINDOW 3 0 112 Left 0
WINDOW 123 0 144 Left 0
WINDOW 39 0 176 Left 0
SYMATTR Value tripdt=1n td=200n
SYMATTR Value2 Cout=33n Rout=10m
SYMATTR SpiceLine Vhigh=45 Vlow=-45
SYMATTR InstName A2
TEXT 368 384 Left 0 !.tran 0 {Td} 10u uic
TEXT 248 320 Left 0 !.param Vdc=0 Vp=1 f1=2k5 f2=250k Td=4m
TEXT 472 -224 Left 0 ;To plot frequency on the\nhorizontal axis change\nthe quantity plotted to\n"V(f)*1Hz/1V" and click\n"Logarithmic"
TEXT 704 -32 Center 0 ;35kHz
TEXT 480 -32 Center 0 ;400kHz
TEXT 64 -336 Left 0 ;This circuit demonstrates the use of a swept sine source to test \nthe large signal frequency response of an idealized UcD180 style \nself oscillatiing class D amplifier, as a function of input amplitude,\ninput offset, and output load.
TEXT 256 232 Left 0 ;Sweep Parameters:\nf1 = start freq f2= stop freq Td = sweep duration\nVp = sine peak Vdc = sine offset
TEXT 408 -392 Center 0 ;Swept Sine Analysis - analogspiceman 2005
TEXT 248 352 Left 0 !.step param Vdc list 0 -4 -8
RECTANGLE Normal 672 -368 144 -416 1
.