Math Puzzle...

In LT Spice, examining power dissipation in a switcher, you've got to be careful to include a lot of cycles or an exact integer number of cycles. The difference between asynchronously including 4 shots or 5 shots can be 25%. That's one reason I prefer building lowpass filters into the instrumentation.

Reply to
John Larkin
Loading thread data ...

I dated sisters once. They were very different.

Reply to
John Larkin

Billie Jo, Bobby Jo, and Betty Jo? ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 USA 
+1 845 480 2058 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

Only two. Even two is too confusing. It wasn't my fault.

Reply to
John Larkin

Under their skin?

Reply to
Michael A. Terrell

On 7/7/2013 10:34 AM, John Larkin wrote:

Very well. My thought is that the equations for efficiency do not work well even when run through an averaging network. So, to test that I modified your circuit as shown below. It averages the input power using your filter and averages the output power using your filter and then divides the output by the input, again averaged by your filter.

This is a learning experience for me, so let me know what you think.

Version 4 SHEET 1 2628 1092 WIRE 224 96 96 96 WIRE -48 144 -96 144 WIRE -16 144 -48 144 WIRE 96 144 96 96 WIRE 240 144 96 144 WIRE 320 144 240 144 WIRE 464 144 400 144 WIRE 528 144 464 144 WIRE 656 144 608 144 WIRE 912 144 864 144 WIRE 1056 144 992 144 WIRE 1152 144 1056 144 WIRE 1264 144 1216 144 WIRE 1312 144 1264 144 WIRE 1440 144 1392 144 WIRE 1456 144 1440 144 WIRE 1472 144 1456 144 WIRE -96 176 -96 144 WIRE 96 176 96 144 WIRE 240 240 240 144 WIRE 320 240 240 240 WIRE 464 240 464 144 WIRE 464 240 384 240 WIRE 1264 240 1264 144 WIRE 1312 240 1264 240 WIRE 1440 240 1440 144 WIRE 1440 240 1376 240 WIRE 1440 288 1440 240 WIRE 608 304 576 304 WIRE 656 304 656 144 WIRE 656 304 608 304 WIRE 736 304 656 304 WIRE 864 304 864 144 WIRE 864 304 800 304 WIRE -96 320 -96 256 WIRE 96 320 96 256 WIRE 656 336 656 304 WIRE 1056 336 1056 144 WIRE 864 352 864 304 WIRE 304 384 272 384 WIRE 400 384 368 384 WIRE 1440 400 1440 352 WIRE 656 432 656 416 WIRE -48 448 -96 448 WIRE -16 448 -48 448 WIRE 144 448 96 448 WIRE 272 448 272 384 WIRE 272 448 224 448 WIRE 304 448 272 448 WIRE 400 448 400 384 WIRE 400 448 368 448 WIRE 864 448 864 416 WIRE -96 480 -96 448 WIRE 1056 480 1056 416 WIRE 272 512 272 448 WIRE 304 512 272 512 WIRE 400 512 400 448 WIRE 400 512 368 512 WIRE 432 512 400 512 WIRE 560 512 512 512 WIRE 608 512 560 512 WIRE 96 576 96 448 WIRE 160 576 96 576 WIRE 272 576 272 512 WIRE 272 576 224 576 WIRE 304 576 272 576 WIRE 400 576 400 512 WIRE 400 576 368 576 WIRE 1056 592 1056 544 WIRE -96 624 -96 560 WIRE 400 624 368 624 WIRE 544 624 512 624 WIRE 656 624 656 528 WIRE 656 624 624 624 WIRE 368 656 368 624 WIRE 2064 656 2000 656 WIRE 2208 656 2144 656 WIRE 2256 656 2208 656 WIRE 2272 656 2256 656 WIRE 1120 672 1056 672 WIRE 1264 672 1200 672 WIRE 1312 672 1264 672 WIRE 1328 672 1312 672 WIRE 1520 672 1456 672 WIRE 1664 672 1600 672 WIRE 1712 672 1664 672 WIRE 1728 672 1712 672 WIRE 512 688 512 624 WIRE 512 688 400 688 WIRE 656 688 656 624 WIRE 96 704 96 576 WIRE 144 704 96 704 WIRE 320 704 144 704 WIRE 2000 704 2000 656 WIRE 448 720 400 720 WIRE 464 720 448 720 WIRE 512 720 512 688 WIRE 1056 720 1056 672 WIRE 1456 720 1456 672 WIRE 2208 720 2208 656 WIRE 1264 736 1264 672 WIRE 1664 736 1664 672 WIRE 368 768 368 752 WIRE 384 768 384 752 WIRE 384 768 368 768 WIRE 368 784 368 768 WIRE 512 816 512 784 WIRE 656 816 656 768 WIRE 400 832 368 832 WIRE 368 864 368 832 WIRE 2000 864 2000 784 WIRE 2208 864 2208 784 WIRE 1056 880 1056 800 WIRE 1264 880 1264 800 WIRE 1456 880 1456 800 WIRE 1664 880 1664 800 WIRE 656 896 400 896 WIRE 736 896 656 896 WIRE 864 896 816 896 WIRE 896 896 864 896 WIRE 96 912 96 704 WIRE 320 912 96 912 WIRE 96 928 96 912 WIRE 448 928 400 928 WIRE 480 928 448 928 WIRE 656 928 656 896 WIRE 368 976 368 960 WIRE 384 976 384 960 WIRE 384 976 368 976 WIRE 368 992 368 976 WIRE 96 1040 96 992 WIRE 656 1040 656 1008 FLAG 1456 144 VP FLAG 656 816 0 FLAG 96 320 0 FLAG 608 304 DRAIN FLAG 560 512 GATE FLAG 864 448 0 FLAG 1056 592 0 FLAG 1056 880 0 FLAG 1312 672 num FLAG 1264 880 0 FLAG 96 1040 0 FLAG 144 704 rc FLAG 1440 400 0 FLAG 224 96 9V FLAG 368 784 0 FLAG 400 624 9V FLAG 448 720 0.2V FLAG -96 320 0 FLAG -48 144 0.2V FLAG 368 992 0 FLAG 400 832 9V FLAG -96 624 0 FLAG -48 448 1.25V FLAG 448 928 1.25V FLAG 656 1040 0 FLAG 864 896 VP FLAG 512 816 0 FLAG 1456 880 0 FLAG 1712 672 den FLAG 1664 880 0 FLAG 2000 864 0 FLAG 2256 656 eff FLAG 2208 864 0 SYMBOL ind2 512 160 R270 WINDOW 0 -41 56 VTop 2 WINDOW 3 -53 53 VBottom 2 SYMATTR InstName L1 SYMATTR Value 5u SYMATTR Type ind SYMATTR SpiceLine Rser=0.06 SYMBOL schottky 1152 160 R270 WINDOW 0 -41 30 VTop 2 WINDOW 3 -49 27 VBottom 2 SYMATTR InstName D1 SYMATTR Value 10MQ060N SYMATTR Description Diode SYMATTR Type diode SYMBOL voltage 96 160 R0 WINDOW 0 60 48 Left 2 WINDOW 3 67 80 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V2 SYMATTR Value 9 SYMBOL nmos 608 432 R0 WINDOW 0 -55 -55 Left 2 WINDOW 3 -101 -22 Left 2 SYMATTR InstName M1 SYMATTR Value Si7218DN SYMBOL ind2 896 160 R270 WINDOW 0 -32 56 VTop 2 WINDOW 3 -41 57 VBottom 2 SYMATTR InstName L2 SYMATTR Value 5u SYMATTR Type ind SYMATTR SpiceLine Rser=0.06 SYMBOL res 528 496 R90 WINDOW 0 -15 56 VBottom 2 WINDOW 3 46 56 VTop 2 SYMATTR InstName R3 SYMATTR Value 10 SYMBOL res 1296 160 R270 WINDOW 0 -38 31 VTop 2 WINDOW 3 -11 86 VBottom 2 SYMATTR InstName R6 SYMATTR Value 1m SYMBOL cap 1376 224 R90 WINDOW 0 68 59 VBottom 2 WINDOW 3 42 -8 VTop 2 SYMATTR InstName C3 SYMATTR Value 50m SYMBOL res 304 160 R270 WINDOW 0 -37 24 VTop 2 WINDOW 3 -11 88 VBottom 2 SYMATTR InstName R8 SYMATTR Value 1m SYMBOL cap 384 224 R90 WINDOW 0 71 54 VBottom 2 WINDOW 3 43 0 VTop 2 SYMATTR InstName C6 SYMATTR Value 50m SYMBOL res 1040 320 R0 WINDOW 0 59 38 Left 2 WINDOW 3 58 74 Left 2 SYMATTR InstName R9 SYMATTR Value 500 SYMBOL cap 1040 480 R0 WINDOW 0 -46 35 Left 2 WINDOW 3 -50 68 Left 2 SYMATTR InstName C7 SYMATTR Value 30p SYMBOL bv 1056 704 R0 WINDOW 3 -110 247 Left 2 WINDOW 0 -83 97 Left 2 SYMATTR Value V=V(VP)*I(C5) SYMATTR InstName B1 SYMBOL res 1216 656 R90 WINDOW 0 70 60 VBottom 2 WINDOW 3 78 61 VTop 2 SYMATTR InstName R1 SYMATTR Value 1000 SYMBOL cap 1248 736 R0 WINDOW 0 -37 63 Left 2 WINDOW 3 -43 94 Left 2 SYMATTR InstName C2 SYMATTR Value 10n SYMBOL Digital\\schmtinv 160 512 R0 SYMATTR InstName A1 SYMATTR Value2 Vhigh=5 Vt=2.5 Vh=0.5 SYMATTR SpiceLine Td=5n SYMBOL cap 80 928 R0 WINDOW 0 44 60 Left 2 WINDOW 3 37 92 Left 2 SYMATTR InstName C4 SYMATTR Value 500p SYMBOL res 128 464 R270 WINDOW 0 88 58 VTop 2 WINDOW 3 74 57 VBottom 2 SYMATTR InstName R4 SYMATTR Value 2K SYMBOL Digital\\schmtinv 304 448 R0 SYMATTR InstName A2 SYMATTR Value2 Vhigh=5 Vt=2.5 Vh=1 SYMATTR SpiceLine Td=5n SYMBOL Digital\\schmtinv 304 384 R0 SYMATTR InstName A3 SYMATTR Value2 Vhigh=5 Vt=2.5 Vh=1 SYMATTR SpiceLine Td=5n SYMBOL Digital\\schmtinv 304 512 R0 SYMATTR InstName A4 SYMATTR Value2 Vhigh=5 Vt=2.5 Vh=1 SYMATTR SpiceLine Td=5n SYMBOL Digital\\schmtinv 304 320 R0 SYMATTR InstName A5 SYMATTR Value2 Vhigh=5 Vt=2.5 Vh=1 SYMATTR SpiceLine Td=5n SYMBOL cap 1424 288 R0 WINDOW 0 -70 43 Left 2 WINDOW 3 -64 77 Left 2 SYMATTR InstName C5 SYMATTR Value 4u SYMBOL res 640 320 R0 WINDOW 0 47 70 Left 2 WINDOW 3 41 102 Left 2 SYMATTR InstName R7 SYMATTR Value 1m SYMBOL res 640 672 R0 WINDOW 0 70 52 Left 2 WINDOW 3 75 86 Left 2 SYMATTR InstName R10 SYMATTR Value 0.2 SYMBOL Comparators\\LT1011 368 704 M0 SYMATTR InstName U1 SYMBOL voltage -96 160 R0 WINDOW 0 63 53 Left 2 WINDOW 3 61 85 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value 0.2 SYMBOL Comparators\\LT1011 368 912 M0 SYMATTR InstName U2 SYMBOL voltage -96 464 R0 WINDOW 0 61 45 Left 2 WINDOW 3 54 83 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V3 SYMATTR Value 1.25 SYMBOL res 640 912 R0 WINDOW 0 -56 37 Left 2 WINDOW 3 -57 71 Left 2 SYMATTR InstName R5 SYMATTR Value 1K SYMBOL res 832 880 R90 WINDOW 0 69 56 VBottom 2 WINDOW 3 74 56 VTop 2 SYMATTR InstName R11 SYMATTR Value 37.4K SYMBOL cap 800 288 R90 WINDOW 0 0 32 VBottom 2 WINDOW 3 32 32 VTop 2 SYMATTR InstName C1 SYMATTR Value 2u SYMBOL res 640 608 R90 WINDOW 0 65 54 VBottom 2 WINDOW 3 71 54 VTop 2 SYMATTR InstName R2 SYMATTR Value 1K SYMBOL cap 496 720 R0 WINDOW 0 54 32 Left 2 WINDOW 3 43 63 Left 2 SYMATTR InstName C8 SYMATTR Value 300p SYMBOL schottky 880 416 R180 WINDOW 0 42 2 Left 2 WINDOW 3 -44 -85 Left 2 SYMATTR InstName D2 SYMATTR Value 10MQ060N SYMATTR Description Diode SYMATTR Type diode SYMBOL bv 1456 704 R0 WINDOW 3 -110 247 Left 2 WINDOW 0 -83 97 Left 2 SYMATTR Value v=-V(9V)*I(V2) SYMATTR InstName B2 SYMBOL res 1616 656 R90 WINDOW 0 70 60 VBottom 2 WINDOW 3 78 61 VTop 2 SYMATTR InstName R12 SYMATTR Value 1000 SYMBOL cap 1648 736 R0 WINDOW 0 -37 63 Left 2 WINDOW 3 -43 94 Left 2 SYMATTR InstName C9 SYMATTR Value 10n SYMBOL bv 2000 688 R0 WINDOW 3 -110 247 Left 2 WINDOW 0 -83 97 Left 2 SYMATTR Value V=100*v(num)/v(den) SYMATTR InstName B3 SYMBOL res 2160 640 R90 WINDOW 0 70 60 VBottom 2 WINDOW 3 78 61 VTop 2 SYMATTR InstName R13 SYMATTR Value 1000 SYMBOL cap 2192 720 R0 WINDOW 0 -37 63 Left 2 WINDOW 3 -43 94 Left 2 SYMATTR InstName C10 SYMATTR Value 10n TEXT 1184 576 Left 2 !.tran 0 4m 0 uic TEXT 1168 480 Left 2 ;SKEPTIC CONVERTER TEXT 1208 528 Left 2 ;JL July 3 2013 TEXT 688 128 Left 2 !K L1 L2 0.99 TEXT 192 624 Left 2 ;74HC14 TEXT 160 504 Left 2 ;OSC TEXT 736 176 Left 2 ;1:1 TEXT 160 808 Left 2 ;USE LM393

Reply to
John S

On Sun, 07 Jul 2013 18:51:41 -0500, John S wrote:

You're ignoring my bypassed shunt resistors and sensing the raw/fast currents, and then lowpass filtering the power products. That's equivalent to using my bypassed shunts, except that your filters are faster, 10 us to my 50 us.

I think there's a danger in dividing things, to get efficiency, that have a lot of ripple. The power peaks in the input side and the output side happen at different times. The B3 waveform is pretty ragged, and that may indicate some nonlinear things going on.

Slow filtering of the current signals smooths things out at the expense of time lag in the efficiency calc. There's another math hazard on the output side, when the output voltage is changing rapidly... that can interact with the current sensing lag. Messy. On the input side, the 9 volts is stiff, so filtering the current just filters the power, but doesn't otherwise distort it.

The lags can be reduced by using a higher-order filter. In the netlist below, I built 2nd order shunts. You could do a similar thing by using higher order filters, RLC maybe, to create num and dem. We want to filter out the switching spikes without badly slowing down the average current and power values.

The mathematically correct way to do this is to work in time blocks and compute (integrate) the energy in and the energy out, then divide. That has its its own issues.

Version 4 SHEET 1 3540 2452 WIRE 1216 1056 1168 1056 WIRE 1264 1056 1216 1056 WIRE 1376 1056 1344 1056 WIRE 1520 1056 1456 1056 WIRE 1808 1056 1520 1056 WIRE 1920 1056 1808 1056 WIRE 2112 1056 2000 1056 WIRE 2240 1056 2192 1056 WIRE 2304 1056 2240 1056 WIRE 2432 1056 2384 1056 WIRE 2560 1056 2496 1056 WIRE 2624 1056 2560 1056 WIRE 2768 1056 2704 1056 WIRE 2912 1056 2848 1056 WIRE 2960 1056 2912 1056 WIRE 3008 1056 2960 1056 WIRE 2112 1072 2112 1056 WIRE 2192 1072 2192 1056 WIRE 1168 1152 1168 1056 WIRE 1312 1152 1168 1152 WIRE 1520 1152 1520 1056 WIRE 1520 1152 1376 1152 WIRE 2560 1152 2560 1056 WIRE 2720 1152 2560 1152 WIRE 2912 1152 2912 1056 WIRE 2912 1152 2784 1152 WIRE 2912 1168 2912 1152 WIRE 1968 1184 1936 1184 WIRE 2112 1184 2112 1152 WIRE 2112 1184 2048 1184 WIRE 1808 1232 1808 1056 WIRE 1936 1232 1936 1184 WIRE 1168 1248 1168 1152 WIRE 2912 1280 2912 1232 WIRE 1520 1312 1520 1152 WIRE 1728 1312 1520 1312 WIRE 2064 1312 2016 1312 WIRE 2112 1312 2112 1184 WIRE 2112 1312 2064 1312 WIRE 2240 1312 2112 1312 WIRE 2352 1312 2304 1312 WIRE 2352 1360 2352 1312 WIRE 1168 1392 1168 1328 WIRE 2192 1392 2192 1152 WIRE 2192 1392 2016 1392 WIRE 1296 1472 1168 1472 WIRE 1504 1472 1376 1472 WIRE 1584 1472 1504 1472 WIRE 1728 1472 1584 1472 WIRE 2064 1472 2016 1472 WIRE 2192 1472 2144 1472 WIRE 1168 1504 1168 1472 WIRE 1504 1536 1504 1472 WIRE 1168 1632 1168 1584 WIRE 1504 1632 1504 1600 WIRE 1808 1648 1808 1552 WIRE 1936 1648 1936 1552 WIRE 2192 1648 2192 1472 WIRE 2592 1696 2560 1696 WIRE 2624 1696 2592 1696 WIRE 2560 1744 2560 1696 WIRE 1296 1872 1168 1872 WIRE 1504 1872 1376 1872 WIRE 1568 1872 1504 1872 WIRE 1616 1872 1568 1872 WIRE 1856 1872 1760 1872 WIRE 1936 1872 1856 1872 WIRE 2016 1872 1936 1872 WIRE 2144 1872 2096 1872 WIRE 2176 1872 2144 1872 WIRE 1168 1888 1168 1872 WIRE 2560 1904 2560 1824 WIRE 1504 1920 1504 1872 WIRE 1936 1920 1936 1872 WIRE 1168 2016 1168 1968 WIRE 1504 2016 1504 1984 WIRE 1936 2032 1936 2000 FLAG 2912 1280 0 FLAG 2192 1648 0 FLAG 1936 1648 0 FLAG 1808 1648 0 FLAG 1168 1392 0 FLAG 1216 1056 9V FLAG 2960 1056 VP FLAG 2560 1904 0 FLAG 2592 1696 EFF FLAG 2064 1312 SW FLAG 2240 1056 DIO FLAG 2352 1360 0 FLAG 2144 1872 VP FLAG 1584 1472 RUN FLAG 1504 1632 0 FLAG 1936 2032 0 FLAG 1568 1872 DONE FLAG 1168 1632 0 FLAG 1856 1872 VD FLAG 1504 2016 0 FLAG 1168 2016 0 SYMBOL ind2 2096 1056 R0 WINDOW 0 -10 38 Right 2 WINDOW 3 -12 66 Right 2 SYMATTR InstName L1 SYMATTR Value 2µ SYMBOL ind2 2208 1168 R180 WINDOW 0 -16 70 Right 2 WINDOW 3 -12 39 Right 2 SYMATTR InstName L2 SYMATTR Value 18µ SYMBOL RES 2064 1168 R90 WINDOW 0 -10 106 VBottom 2 WINDOW 3 -38 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 49.9K SYMBOL cap 2896 1168 R0 WINDOW 0 52 27 Left 2 WINDOW 3 50 64 Left 2 SYMATTR InstName C1 SYMATTR Value 10µ SYMATTR SpiceLine Rpar=.1Meg SYMBOL schottky 2432 1072 R270 WINDOW 0 -38 43 VTop 2 WINDOW 3 -49 46 VBottom 2 SYMATTR InstName D1 SYMATTR Value BAT46WJ SYMATTR Description Diode SYMATTR Type diode SYMBOL res 2048 1488 R270 WINDOW 0 -44 35 VTop 2 WINDOW 3 -17 75 VBottom 2 SYMATTR InstName R2 SYMATTR Value 2K SYMBOL VOLTAGE 1168 1232 R0 WINDOW 0 58 37 Left 2 WINDOW 3 59 73 Left 2 SYMATTR InstName V1 SYMATTR Value 9 SYMBOL res 1360 1072 R270 WINDOW 0 -37 34 VTop 2 WINDOW 3 -9 80 VBottom 2 SYMATTR InstName R5 SYMATTR Value 1m SYMBOL cap 1376 1136 R90 WINDOW 0 76 63 VBottom 2 WINDOW 3 49 8 VTop 2 SYMATTR InstName C3 SYMATTR Value 25m SYMBOL PowerProducts\\LT3420-1 1872 1392 R0 SYMATTR InstName U2 SYMBOL bv 2560 1728 R0 WINDOW 3 -229 240 Left 2 WINDOW 0 -76 133 Left 2 SYMATTR Value V= LIMIT (0, 100 * I(R7) * V(VP) / ( I(R5) * 9 ), 100) SYMATTR InstName B1 SYMBOL res 2608 1072 R270 WINDOW 0 -41 38 VTop 2 WINDOW 3 -14 85 VBottom 2 SYMATTR InstName R7 SYMATTR Value 1m SYMBOL cap 2784 1136 R90 WINDOW 0 74 68 VBottom 2 WINDOW 3 47 5 VTop 2 SYMATTR InstName C5 SYMATTR Value 25m SYMBOL ind 1248 1072 R270 WINDOW 0 -35 27 VTop 2 WINDOW 3 -8 83 VBottom 2 SYMATTR InstName L4 SYMATTR Value 25n SYMBOL ind 2752 1072 R270 WINDOW 0 -33 25 VTop 2 WINDOW 3 -3 76 VBottom 2 SYMATTR InstName L5 SYMATTR Value 25n SYMBOL zener 2304 1296 R90 WINDOW 0 72 33 VBottom 2 WINDOW 3 80 32 VTop 2 SYMATTR InstName D2 SYMATTR Value ZNR48 SYMATTR Description Diode SYMATTR Type diode SYMBOL res 2288 1072 R270 WINDOW 0 -33 54 VTop 2 WINDOW 3 -44 56 VBottom 2 SYMATTR InstName R6 SYMATTR Value 0.480 SYMBOL res 1904 1072 R270 WINDOW 0 -33 33 VTop 2 WINDOW 3 -6 87 VBottom 2 SYMATTR InstName R8 SYMATTR Value 0.24 SYMBOL res 2112 1856 R90 WINDOW 0 -48 63 VBottom 2 WINDOW 3 -37 57 VTop 2 SYMATTR InstName R11 SYMATTR Value 46.75K SYMBOL res 1392 1456 R90 WINDOW 0 -54 53 VBottom 2 WINDOW 3 -44 53 VTop 2 SYMATTR InstName R13 SYMATTR Value 1K SYMBOL cap 1488 1536 R0 WINDOW 0 67 15 Left 2 WINDOW 3 65 49 Left 2 SYMATTR InstName C2 SYMATTR Value 1n SYMBOL res 1920 1904 R0 WINDOW 0 66 38 Left 2 WINDOW 3 55 76 Left 2 SYMATTR InstName R9 SYMATTR Value 1.25K SYMBOL bv 1168 1488 R0 WINDOW 0 33 115 Left 2 WINDOW 3 20 193 Left 2 SYMATTR InstName B2 SYMATTR Value V = LIMIT( 0, 5, 5000 * (1.25 - V(VD) ) ) SYMBOL res 1392 1856 R90 WINDOW 0 -15 75 VBottom 2 WINDOW 3 -39 23 VTop 2 SYMATTR InstName R3 SYMATTR Value 1K SYMBOL cap 1488 1920 R0 WINDOW 0 67 38 Left 2 WINDOW 3 65 75 Left 2 SYMATTR InstName C4 SYMATTR Value 1n SYMBOL bv 1168 1872 R0 WINDOW 0 35 122 Left 2 WINDOW 3 23 -95 Left 2 SYMATTR InstName B3 SYMATTR Value V = LIMIT( 1, 10, 5000 * ( V(VD) - 1.20 ) ) TEXT 2456 1576 Left 2 !.tran 0 10m 0 20n TEXT 2248 1240 Left 2 !K1 L1 L2 0.95 TEXT 2144 1192 Left 2 ;1:3 TEXT 2224 1200 Left 2 ;LPR4012-202DML TEXT 1224 1728 Left 2 ;COMPARATORS: USE LM393 TEXT 2456 1464 Left 2 ;LT3420-1 WITH HELP TEXT 2472 1520 Left 2 ;JL July 7, 2013 TEXT 1248 1544 Left 2 ;RUN COMPARATOR TEXT 1232 1928 Left 2 ;DONE COMPARATOR

Reply to
John Larkin

n

think.

that's full of

ite sure of

following the

digression.

rgence

limit

kes Spice

e using

m at all

to

time

h is in

ptotes

orders.

elpful in

used in

ntinuity

be dealt

lamps.

0s, and

ather

-topic

This

dergarten.

pute

,

such

ount

ites

se.

ce

ial

e up

st

name

flamed down now),

discussed here.

e converter to boost to a capacitor and draw load intermittent from that no de and in that case Larkin is right, that what is important is the efficien cy during charging of the capacitor. Low load efficiency is irrelevant and shortime, more than 100% efficiency from charge and discharging effects can be ignored in some cases.

rter is calculated by energy in and energy out, so the integration trick is used. (the integrated trick can also be used for the charge waveform, but LTSpice does not have the handles for that)

Indeed. To get fast results and not wait for the simulation to settle, I no rmally setup different scenarios. For a steady state the capacitor voltages and inductor currents are calculated and set for initial value, which make simulations settle very fast

Someone should write a book on simulation tips and tricks. After a lot of s imulation one gets a hang of it; How to start the circuits up to avoid long transient simulations, when to be critical of simulation results and when to call it quits and build the circuit in real life.

My experience is that simulations, even if they don't model the circuits 10

0% correctly, still saves PCB spins and certainly a lot of time and money a nd not least reduces risks of project scheduling delays.

ve on in life? (so the rest of us can read usenet posts without spending ti me on reading flamewars between two otherwise very knowledgeable guys)

n boost converter instead of this new topology instead of inventing (or re- inventing) a new one (I may have missed a critical point in between the "fl ames", excuse me for that)?

But instead of that switcher, use a microcontroller for that. You can add a ll sort of tricks features in firmware and if you build it right you can st ill get current mode control if that is needed.

I almost always try to see first if I can do it without an IC (habit of the days I did Space designs where the most advanced IC we had was the LM290x)

Cheers

Klaus

Reply to
Klaus Kragelund

If I actually put the 4000 uF caps into my flyback model, it would run for days and generate more .RAW file than I have hard drive to hold. It's running 5-10 PPM of real time. 1 second becomes 30 hours. I'll learn what I can using a smaller cap in sim, then breadboard it.

Is there a good LT Spice book? The HELP is often cryptic.

I think we will go digital, next generation, with a small ARM. Analog first, to get the customer going, and better define the problem.

Reply to
John Larkin

Discontinuities in gradient or worse still value hurt simulations.

You might want to also try

x.|x|/(1+x^2)

or

x^3/(1+|x^3|)

The latter has a bit of slop like x^3 around x=0

Both have the same limit properties on -1,1 but are computationally faster on most platforms (the numerator of tanh is tricky and error prone in some implementations which can make life interesting).

To soften or harden it adjust the value of one ;-)

--
Regards, 
Martin Brown
Reply to
Martin Brown

To start with that is an out of context question. The function as presented does not have a definition, let alone a formal definition.

That said, in a spice context it should bound the values returned by f(x) to be between 0 and 120. Is that the answer you wanted?

?-)

Reply to
josephkk

Then your model is obviously incompetent. A proper model would not have those freak values.

?-)

Reply to
josephkk

I've had great success with TANH, at least in PSpice. I don't think I've done it in LTspice, though I might have incidentally used it... I mostly just run netlists generated from other sources. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

Yep, It's a non-linear operation ;-) ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson
[snip]
[snip]

Substantial tutorial...

formatting link

Making your own subcircuits...

formatting link

There is also a SCAD4 Manual, 206 pages of information, but I can't find my way back to the page where I found it :-( Anyone interested, drop me an E-mail and I'll send you a copy.

I had an original 2G6 (Fortran) manual, but gave it away ;-) ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

The LTC comparators pull tens of amps at powerup. I didn't write that model. Things can also ring for nanoseconds, which means stuff can cross through zero. I really don't think the first few picoseconds matter, so I just ignore any brief startup weirdness by clipping the values.

The intent is to build stuff that works.

Reply to
John Larkin

John, you are doing it the right way. To address the complaints from JT about accuracy, he posted a request to the Yahoo LTspice forum on Fri Jul

5, 2013 6:51 pm. Here is the post:

Is there any way, in a LTspice plot, to _display_ the average of a waveform over a specified interval? Something like the AVGX mechanism in PSpice's Probe?

-Jim Thompson

formatting link

formatting link

His request was answered > Is there any way, in a LTspice plot, to _display_ the average of a > waveform over a specified interval? Something like the AVGX > mechanism in PSpice's Probe?

Mike Engelhardt has stated that he is philosophically opposed to such imprecise functions. What is average? Is it an analog low pass filter function or a numerical sliding average? What order is it and what is its corner frequency/period? Is it a fixed percentage of the total simulation run time or perhaps some percentage the time interval as currently displayed within the Waveform viewer (thus changing every time the zoom level is changed)?

Average and Integrate would be very useful visualization tools for to help analyze data after a simulation completes (right now, if you don't plan ahead, you must rerun after adding those functions within the schematic), but in order to be acceptable to Mike, they would have to be much more precisely defined (perhaps via multiple, optional parameters) than the Pspice versions.

The LTspice waveform viewer does not currently offer a "running average" function (it only makes available a single numeric average for the entire data set displayed in the currently visible window).

I don't see any technical reason why the waveform viewer shouldn't be able to generate a running average, but Mike Engelhardt seems to think that an auto adjusting running average would be too ill defined (dependent on window span and an arbitrary averaging function) and therefore misleading or at best a poor general purpose compromise to what is actually needed in a vast variety of individual circumstances (personally, I think that Mike may be overlooking that the value of a running average would be more qualitative than quantitative - it would be primarily a visualization aid).

If you really must have a running average, you could always add into the simulation a simple low pass circuit to the signal of interest to calculate a running average of the appropriate time constant for your visualization needs. You would then click on the LP output to see the running average in the waveform viewer (of course, this requires you to set it up ahead of time or to go back, add the LP and rerun the simulation - not very user friendly).

[...]

formatting link

So clearly the lowpass filtering method you are using is correct. As far as the AVGX function Jim wanted, here is a description from PSPICE tutorial:

AVG(x) running average of x over the range of the X axis variable. AVGX(x,d) running average of X (from x-d to x) over the range of the X axis variable.

It appears these functions are pretty sloppy. Here are examples on page 4 of a homework exercise in

"

formatting link
_solution.pdf"

Note the author's statement (ignore spelling and typo)

Fig. 5 Example of peak detector simulation. Note thaf function AVG() (dashed line) makes averaging from the start point and takes into accout transient process. One need to run simulation for long time to get good approximation. AVGX() starts averaging from the specific point and one can get more presise results.

The AVG function in Fig. 4 looks very similar to lowpass filtering. The AVGX function starts out wierd, then settles on the value that the AVG function is approaching asymptotically. However, it is not clear how either function would handle varying waveforms, such as in the charging circuit you are working with. Certainly, a lowpass filter gives more information as you can see the input to the lpf, and it can be tailored to whatever bandwidth you are interested in.

To summarize, Mike Engelhardt omitted the PSPICE AVG and AVGX function from LTspice because of lack of precision.

To provide this function in LTspice, analogspiceman recommends "a simple low pass circuit to the signal of interest", which is exactly what you are doing.

JK

Reply to
John K

Thanks. I'll check that out when I have more time.

Sounds like AVG(x) may use rectangular windowing, which could be bad in a switcher.

I don't use Spice a lot, so instead of invoking a bunch of equations, I prefer to use parts to build test equipment into the simulation, just as I might on a breadboard. I'm more visual than verbal, so I can see a shunt resistor or a lowpass filter easier than I can read an equation.

The B source is cool, though, because it lets you compute something (like efficiency) that you can click on and graph when you feel like.

Hey, discovery! If you hit the space bar, LTC fills the screen with your schematic.

Reply to
John Larkin

I inquired if there was an equivalent function in LTspice to PSpice's AVG and AVGX. Except for Helmut's helpful response, I got philosophy about time constants, etc... meaningless folderol...

AVG and AVGX use Simpson's Rule (*)... no time constants involved... nor are there any data "spacing" or "sampling" problems.

AVGX will give errors if "X" isn't large compared to the period... unless, of course, in a clocked system, one can choose "X" equal to the clock period.

Improper use of a tool _will_ give erroneous results. As will data compression in LTspice. Some will blame the tool :-(

(*) In the good ol' days, many employment exams included a squiggly curve (not defined by equation), with the request to integrate the curve from point "A" to point "B" >:-} ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson
[snip]

Forgot to add... AVG and AVGX don't need to be incorporated into the schematic as is required by LTspice...

AVG and AVGX are post-processor functions built into PSpice Probe, as are many other mathematical functions, as well as being customizable with your own macro functions... I have several dozen. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.