Sequential Machines in LTSpice

I want to make a behavioral model of a power supply controller (a vastly simplified UCC28060). I want to do things like trigger a one-shot whenever a voltage drops below zero.

Does anyone have a favorite way to do this?

I'm thinking voltage -> comparator 1 -> 'S' on SR flip-flop -> Q* to gate of FET -> that shorts a current source -> that charges a cap -> comparator 2 -> reset the SR.

This has weaknesses -- not least of which is that the original triggering voltage will be zero as a consequence of the timer being active, which means I need to cook up an edge triggered flip flop (maybe they have a clocked D flip flop I can use).

At any rate, I don't often get to this depth with LTSpice, so if anyone has cleverness to share I'll listen.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Reply to
Tim Wescott
Loading thread data ...

On Fri, 12 Mar 2010 10:49:45 -0800, Tim Wescott wrote:

--- Version 4 SHEET 1 1092 680 WIRE -48 -240 -352 -240 WIRE 64 -240 -48 -240 WIRE 416 -240 64 -240 WIRE 64 -208 64 -240 WIRE -48 -128 -48 -240 WIRE -224 -112 -256 -112 WIRE -80 -112 -144 -112 WIRE 64 -96 64 -128 WIRE 64 -96 -16 -96 WIRE 128 -96 64 -96 WIRE 208 -96 192 -96 WIRE 272 -96 208 -96 WIRE 528 -96 272 -96 WIRE -80 -80 -112 -80 WIRE 208 -64 208 -96 WIRE 272 -64 272 -96 WIRE 640 -48 592 -48 WIRE -112 -32 -112 -80 WIRE -48 -32 -48 -64 WIRE -48 -32 -112 -32 WIRE 416 -32 416 -240 WIRE 528 -32 496 -32 WIRE 640 -16 640 -48 WIRE -48 0 -48 -32 WIRE 496 0 496 -32 WIRE 208 32 208 0 WIRE 272 32 272 16 WIRE 496 32 640 -16 WIRE 640 48 496 0 WIRE 496 64 496 32 WIRE 528 64 496 64 WIRE 640 80 640 48 WIRE 640 80 592 80 WIRE 416 96 416 32 WIRE 528 96 416 96 WIRE 640 96 640 80 WIRE 736 96 640 96 WIRE 640 112 640 96 WIRE 416 128 416 96 WIRE 528 128 496 128 WIRE 736 128 736 96 WIRE -352 144 -352 -240 WIRE -256 144 -256 -112 WIRE 496 224 496 128 WIRE 640 224 640 192 WIRE 640 224 496 224 WIRE 640 240 640 224 WIRE 736 240 736 192 WIRE 736 240 640 240 WIRE 640 256 640 240 WIRE -352 336 -352 224 WIRE -256 336 -256 224 WIRE -256 336 -352 336 WIRE 416 336 416 208 WIRE 416 336 -256 336 WIRE 640 336 640 320 WIRE 640 336 416 336 WIRE -352 416 -352 336 FLAG -352 416 0 FLAG 208 32 0 FLAG 272 32 0 FLAG -48 0 0 SYMBOL res 656 208 R180 WINDOW 0 -39 76 Left 0 WINDOW 3 -46 46 Left 0 SYMATTR InstName R1 SYMATTR Value 1e6 SYMBOL cap 624 256 R0 WINDOW 0 53 14 Left 0 WINDOW 3 46 47 Left 0 SYMATTR InstName C1 SYMATTR Value 2e-6 SYMBOL Digital\\or 560 -128 R0 WINDOW 0 4 -17 Left 0 SYMATTR InstName A1 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL Digital\\or 560 160 M180 WINDOW 0 -30 14 Left 0 SYMATTR InstName A2 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL voltage -256 128 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(-5 5 .1 .5 .5 .1 1.2) SYMATTR InstName V1 SYMBOL cap 192 -112 R90 WINDOW 0 -30 32 VBottom 0 WINDOW 3 -31 32 VTop 0 SYMATTR InstName C2 SYMATTR Value 1e-7 SYMBOL diode 224 0 R180 WINDOW 0 44 34 Left 0 WINDOW 3 24 0 Left 0 SYMATTR InstName D1 SYMATTR Value 1N4148 SYMBOL res 256 -80 R0 SYMATTR InstName R2 SYMATTR Value 100k SYMBOL Comparators\\LT1017 -48 -96 R0 SYMATTR InstName U1 SYMBOL res 48 -224 R0 SYMATTR InstName R3 SYMATTR Value 100k SYMBOL res -128 -128 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R4 SYMATTR Value 10k SYMBOL voltage -352 128 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value 5 SYMATTR InstName V2 SYMBOL cap 400 -32 R0 WINDOW 0 41 30 Left 0 WINDOW 3 23 58 Left 0 SYMATTR InstName C3 SYMATTR Value 1e-7 SYMBOL res 400 112 R0 WINDOW 0 -50 39 Left 0 WINDOW 3 -59 72 Left 0 SYMATTR InstName R5 SYMATTR Value 1e6 SYMBOL diode 752 192 R180 WINDOW 0 -48 34 Left 0 WINDOW 3 -80 3 Left 0 SYMATTR InstName D2 SYMATTR Value 1N4148 TEXT 552 -120 Left 0 ;4001 TEXT -386 440 Left 0 !.tran 5 startup uic

JF

Reply to
John Fields

Linear does provide a D-flip-flop. You can take advantage of the fact that the logic all uses a 0 to 1.0 output and a 0.5 threshold to make oneshots etc. You need to make the parts a little slower than they naturally are using something like a "tau=3D20n". If not they try to be infinitely fast. This can lead to troubles.

Hidden deep in the working of LTSpice is the ability to make a gated oscillator. They use it for their switcher chips. Unfortunately I don't think mere mortals can get to it.

Reply to
MooseFET

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.