Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #394427

Re: LTSPICE square wave

From Joerg <news@analogconsultants.com>
Newsgroups sci.electronics.design
Subject Re: LTSPICE square wave
Date 2016-01-18 13:30 -0800
Message-ID <dg53qqFjur3U2@mid.individual.net> (permalink)
References <dW9ny.159410$_r1.42359@fx24.iad> <r6eq9b91fu5n77eibaq8ssn1drfdp7juuc@4ax.com> <dg51e2Fjbl5U1@mid.individual.net> <likq9bl49m7i6ud9j6i1rgf2t2mn2r8v8j@4ax.com>

Show all headers | View raw


On 2016-01-18 13:00, John Larkin wrote:
> On Mon, 18 Jan 2016 12:49:09 -0800, Joerg <news@analogconsultants.com>
> wrote:
>
>> On 2016-01-18 11:15, John Larkin wrote:
>>> On Mon, 18 Jan 2016 13:12:02 -0500 (EST), bitrex
>>> <bitrex@de.lete.earthlink.net> wrote:
>>>
>>>>
>>>> Is there a way to make a square wave using the LTSPICE ac voltage
>>>> source which doesnt have a DC offset, i.e. alternates between -5
>>>> and +5, say? I can't seem to figure it out. Thanks.
>>>
>>> One handy gadget is BV, the behavioral voltage source. It allows you
>>> to type an equation to make a voltage from something else. You can
>>> square up a sine wave like this:
>>>
>>> Version 4
>>> SHEET 1 880 680
>>> WIRE 96 96 48 96
>>> WIRE 128 96 96 96
>>> WIRE 320 96 272 96
>>> WIRE 352 96 320 96
>>> WIRE 48 144 48 96
>>> WIRE 272 144 272 96
>>> WIRE 48 256 48 224
>>> WIRE 272 256 272 224
>>> FLAG 48 256 0
>>> FLAG 272 256 0
>>> FLAG 96 96 VX
>>> FLAG 320 96 OUT
>>> SYMBOL voltage 48 128 R0
>>> WINDOW 0 55 73 Left 2
>>> WINDOW 3 27 110 Left 2
>>> WINDOW 123 0 0 Left 2
>>> WINDOW 39 0 0 Left 2
>>> SYMATTR InstName V1
>>> SYMATTR Value SINE(0 1 1)
>>> SYMBOL bv 272 128 R0
>>> WINDOW 0 63 61 Left 2
>>> WINDOW 3 29 106 Left 2
>>> SYMATTR InstName B1
>>> SYMATTR Value V=5*sgn(V(VX))
>>> TEXT -144 224 Left 2 !.tran 5
>>> TEXT -200 112 Left 2 ;Sine to Square
>>> TEXT -176 152 Left 2 ;JL  Jan 2016
>>>
>>> That lets you specify the frequency in Hz, as opposed to the pulse
>>> source which makes you work in pulse width and period.
>>>
>>
>> You can make almost any part behavioral, like a resistor whose value
>> depends on the local rain forecast. As long as one does keep in mind
>> when LTSpice becomes a princess on the pea, such as when resistor values
>> drp to zero or get too close to it.
>
> Can a resistor value track some node voltage in real time?
>

Yes. In the same way you did it you just enter an expression such as 
R=((V(X))*1MEG) in place of the resistor value and then it'll follow 
node X with whatever formula you drape around it. Quite handy for 
simulating LDRs, strain gauges or potmeter actuation.

-- 
Regards, Joerg

http://www.analogconsultants.com/

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 13:12 -0500
  Re: LTSPICE square wave Przemek Klosowski <przemek@tux.dot.org> - 2016-01-18 18:20 +0000
    Re: LTSPICE square wave Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2016-01-18 14:05 -0500
      Re: LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 15:38 -0500
        Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 12:42 -0800
        Re: LTSPICE square wave Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2016-01-18 16:55 -0500
  Re: LTSPICE square wave Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-01-18 11:37 -0700
    Re: LTSPICE square wave Tim Wescott  <Tim@seemywebsite.com> - 2016-01-18 11:01 -0800
      Re: LTSPICE square wave "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-01-18 13:20 -0600
    Re: LTSPICE square wave Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-01-21 10:00 -0700
  Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-18 11:15 -0800
    Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 12:49 -0800
      Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-18 13:00 -0800
        Re: LTSPICE square wave Jeroen Belleman <jeroen@nospam.please> - 2016-01-18 22:29 +0100
        Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 13:30 -0800
          Re: LTSPICE square wave Jeroen Belleman <jeroen@nospam.please> - 2016-01-18 22:34 +0100
          Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-18 15:46 -0800
            Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 16:10 -0800
              Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-18 17:20 -0800
                Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-19 07:30 -0800
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-19 08:43 -0800
                Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-19 09:01 -0800
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-19 09:31 -0800
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-19 14:07 -0600
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-19 12:46 -0800
                Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-19 13:22 -0800
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-19 14:51 -0800
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-20 14:18 -0600
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-19 15:23 -0600
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-19 15:07 -0800
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-20 14:30 -0600
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-20 13:22 -0800
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-21 12:02 -0600
                Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-21 10:20 -0800
                Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-21 19:40 -0600
  Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-18 14:11 -0600
    Re: LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 15:44 -0500
      Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 12:52 -0800
        Re: LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 16:20 -0500
          Re: LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 16:24 -0500
            Re: LTSPICE square wave Joerg <news@analogconsultants.com> - 2016-01-18 13:32 -0800
              Re: LTSPICE square wave bitrex <bitrex@de.lete.earthlink.net> - 2016-01-18 17:11 -0500
    Re: LTSPICE square wave John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-18 13:02 -0800
      Re: LTSPICE square wave John Fields <jfields@austininstruments.com> - 2016-01-21 10:39 -0600
  Re: LTSPICE square wave legg <legg@nospam.magma.ca> - 2016-01-18 19:19 -0500

csiph-web