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


Groups > sci.electronics.design > #394383 > unrolled thread

LTSPICE square wave

Started bybitrex <bitrex@de.lete.earthlink.net>
First post2016-01-18 13:12 -0500
Last post2016-01-18 19:19 -0500
Articles 20 on this page of 45 — 11 participants

Back to article view | Back to sci.electronics.design


Contents

  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

Page 1 of 3  [1] 2 3  Next page →


#394383 — LTSPICE square wave

Frombitrex <bitrex@de.lete.earthlink.net>
Date2016-01-18 13:12 -0500
SubjectLTSPICE square wave
Message-ID<dW9ny.159410$_r1.42359@fx24.iad>
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.

-- 


----Android NewsGroup Reader----
http://usenet.sinaapp.com/

[toc] | [next] | [standalone]


#394384

FromPrzemek Klosowski <przemek@tux.dot.org>
Date2016-01-18 18:20 +0000
Message-ID<n7jacu$b5k$1@dont-email.me>
In reply to#394383
On Mon, 18 Jan 2016 13:12:02 -0500, bitrex 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.

two voltage sources in series, one doing PULSE() and the other with 
negative Von/2

[toc] | [prev] | [next] | [standalone]


#394391

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2016-01-18 14:05 -0500
Message-ID<js-dnfPj6PjyqgDLnZ2dnUU7-Y346u6z@supernews.com>
In reply to#394384
On 01/18/2016 01:20 PM, Przemek Klosowski wrote:
> On Mon, 18 Jan 2016 13:12:02 -0500, bitrex 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.
> 
> two voltage sources in series, one doing PULSE() and the other with 
> negative Von/2
> 

Sure.

Voff = -5
Von = 5

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

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#394409

Frombitrex <bitrex@de.lete.earthlink.net>
Date2016-01-18 15:38 -0500
Message-ID<z3cny.278006$qV1.34881@fx25.iad>
In reply to#394391
Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> Wrote in message:
> On 01/18/2016 01:20 PM, Przemek Klosowski wrote:
>> On Mon, 18 Jan 2016 13:12:02 -0500, bitrex 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.
>> 
>> two voltage sources in series, one doing PULSE() and the other with 
>> negative Von/2
>> 
> 
> Sure.
> 
> Voff = -5
> Von = 5
> 
> 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
> 
> hobbs at electrooptical dot net
> http://electrooptical.net
> 

There doesn't appear to be any option for that with the v pulse
 source, just "v_initial" and "v_on"

-- 


----Android NewsGroup Reader----
http://usenet.sinaapp.com/

[toc] | [prev] | [next] | [standalone]


#394410

FromJoerg <news@analogconsultants.com>
Date2016-01-18 12:42 -0800
Message-ID<dg5122Fj3voU2@mid.individual.net>
In reply to#394409
On 2016-01-18 12:38, bitrex wrote:
> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> Wrote in message:
>> On 01/18/2016 01:20 PM, Przemek Klosowski wrote:
>>> On Mon, 18 Jan 2016 13:12:02 -0500, bitrex 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.
>>>
>>> two voltage sources in series, one doing PULSE() and the other with
>>> negative Von/2
>>>
>>
>> Sure.
>>
>> Voff = -5
>> Von = 5
>>

That solution is too simple! :-)


>> 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
>>
>> hobbs at electrooptical dot net
>> http://electrooptical.net
>>
>
> There doesn't appear to be any option for that with the v pulse
>   source, just "v_initial" and "v_on"
>

It's the same thing. Give it a try.

-- 
Regards, Joerg

http://www.analogconsultants.com/

[toc] | [prev] | [next] | [standalone]


#394435

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2016-01-18 16:55 -0500
Message-ID<wsGdnTe6VsPvwgDLnZ2dnUU7-b_46u6z@supernews.com>
In reply to#394409
On 01/18/2016 03:38 PM, bitrex wrote:
> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> Wrote in message:
>> On 01/18/2016 01:20 PM, Przemek Klosowski wrote:
>>> On Mon, 18 Jan 2016 13:12:02 -0500, bitrex 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.
>>>
>>> two voltage sources in series, one doing PULSE() and the other with
>>> negative Von/2
>>>
>>
>> Sure.
>>
>> Voff = -5
>> Von = 5
>>
>> 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
>>
>> hobbs at electrooptical dot net
>> http://electrooptical.net
>>
>
> There doesn't appear to be any option for that with the v pulse
>   source, just "v_initial" and "v_on"
>

V_initial = -5
V_on = 5

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

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#394385

FromJim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com>
Date2016-01-18 11:37 -0700
Message-ID<3hbq9b57tkfk4daa9ae39ic2khr30r9p46@4ax.com>
In reply to#394383
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.

You don't use an _AC_ source to make a square wave, you use a Vpulse
source.

The notation is:

Vx  PosNode NegNode PULSE -5V 5V {TD} {TR} {TF} {PW} {PER}

The timings should be obvious.  However there is a trickiness...

Pulse-width {PW} is set to be true desired pulse width minus {TR}

I have created a true pulse source which has smooth TANH rise and fall
(natch ;-), and {PW} is the real-deal, no scratching of head required.
I haven't ported it to LTspice yet.
		
                                        ...Jim Thompson
-- 
| James E.Thompson                                 |    mens     |
| Analog Innovations                               |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             |
| 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.

[toc] | [prev] | [next] | [standalone]


#394389

FromTim Wescott <Tim@seemywebsite.com>
Date2016-01-18 11:01 -0800
Message-ID<D9GdnbquM77lqwDLnZ2dnUU7-SednZ2d@giganews.com>
In reply to#394385
Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com>
 Wrote in message:
> 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.
> 
> You don't use an _AC_ source to make a square wave, you use a Vpulse
> source.
> 
> The notation is:
> 
> Vx  PosNode NegNode PULSE -5V 5V {TD} {TR} {TF} {PW} {PER}
> 
> The timings should be obvious.  However there is a trickiness...
> 
> Pulse-width {PW} is set to be true desired pulse width minus {TR}
> 
> I have created a true pulse source which has smooth TANH rise and fall
> (natch ;-), and {PW} is the real-deal, no scratching of head required.
> I haven't ported it to LTspice yet.
> 		
>                                         ...Jim Thompson
> -- 
> | James E.Thompson                                 |    mens     |
> | Analog Innovations                               |     et      |
> | Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
> | San Tan Valley, AZ 85142     Skype: skypeanalog  |             |
> | 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.
> 

And you DO want to have some real rise and fall time in there: Tha
 solver can get cranky if you don't. 
-- 
www.wescottdesign.com


----Android NewsGroup Reader----
http://usenet.sinaapp.com/

[toc] | [prev] | [next] | [standalone]


#394399

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-01-18 13:20 -0600
Message-ID<n7jdph$4hd$1@dont-email.me>
In reply to#394389
"Tim Wescott"  wrote in message 
news:D9GdnbquM77lqwDLnZ2dnUU7-SednZ2d@giganews.com...
>
> And you DO want to have some real rise and fall time in there: Tha
> solver can get cranky if you don't.


Indeed, there is no such thing as an "ideal square wave"; a real, physical 
signal must be continuous (including derivatives blah blah), and therefore 
must have a nonzero rise/fall time.

The solver "getting cranky" is a subtle hint that you're trying to model 
something that cannot exist. :)

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [prev] | [next] | [standalone]


#394862

FromJim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com>
Date2016-01-21 10:00 -0700
Message-ID<uf32ab9jcfa0ds6g3ntmdjp32buga5hoil@4ax.com>
In reply to#394385
On Mon, 18 Jan 2016 11:37:13 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> 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.
>
>You don't use an _AC_ source to make a square wave, you use a Vpulse
>source.
>
>The notation is:
>
>Vx  PosNode NegNode PULSE -5V 5V {TD} {TR} {TF} {PW} {PER}
>
>The timings should be obvious.  However there is a trickiness...
>
>Pulse-width {PW} is set to be true desired pulse width minus {TR}
>
>I have created a true pulse source which has smooth TANH rise and fall
>(natch ;-), and {PW} is the real-deal, no scratching of head required.
>I haven't ported it to LTspice yet.
>		
>                                        ...Jim Thompson

See RealPulse.pdf on the Simulation Tools & Macros Page of my website.
		
                                        ...Jim Thompson
-- 
| James E.Thompson                                 |    mens     |
| Analog Innovations                               |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             |
| 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.

[toc] | [prev] | [next] | [standalone]


#394395

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2016-01-18 11:15 -0800
Message-ID<r6eq9b91fu5n77eibaq8ssn1drfdp7juuc@4ax.com>
In reply to#394383
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.




-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#394412

FromJoerg <news@analogconsultants.com>
Date2016-01-18 12:49 -0800
Message-ID<dg51e2Fjbl5U1@mid.individual.net>
In reply to#394395
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.

-- 
Regards, Joerg

http://www.analogconsultants.com/

[toc] | [prev] | [next] | [standalone]


#394415

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2016-01-18 13:00 -0800
Message-ID<likq9bl49m7i6ud9j6i1rgf2t2mn2r8v8j@4ax.com>
In reply to#394412
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?


-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#394426

FromJeroen Belleman <jeroen@nospam.please>
Date2016-01-18 22:29 +0100
Message-ID<n7jlfq$1i8s$2@gioia.aioe.org>
In reply to#394415
On 18/01/16 22:00, John Larkin wrote:
> On Mon, 18 Jan 2016 12:49:09 -0800, Joerg <news@analogconsultants.com>
> wrote:
>
[...]
>>
>> 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?
>
>

Sort of. You can use a behavioral current source like below.
This only works for transient analysis.

Jeroen Belleman

-------------------------
Version 4
SHEET 1 880 680
WIRE -16 112 -96 112
WIRE 48 112 -16 112
WIRE 240 112 192 112
WIRE 272 112 240 112
WIRE -96 144 -96 112
WIRE 48 144 48 112
WIRE 192 144 192 112
WIRE 272 144 272 112
WIRE -96 256 -96 224
WIRE 48 256 48 224
WIRE 192 256 192 224
WIRE 272 256 272 224
FLAG 272 256 0
FLAG 48 256 0
FLAG 192 256 0
FLAG 240 112 resistance
FLAG -96 256 0
FLAG -16 112 val
SYMBOL voltage 48 128 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value SINE(0 1 10)
SYMBOL voltage 272 128 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value PULSE(1 2 1 1 1 3)
SYMBOL res 176 128 R0
SYMATTR InstName R1
SYMATTR Value 1R
SYMBOL bi -96 144 R0
WINDOW 3 22 159 Left 2
SYMATTR InstName B1
SYMATTR Value I=v(val)/v(resistance)
TEXT 88 56 Left 2 !.tran 10

[toc] | [prev] | [next] | [standalone]


#394427

FromJoerg <news@analogconsultants.com>
Date2016-01-18 13:30 -0800
Message-ID<dg53qqFjur3U2@mid.individual.net>
In reply to#394415
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/

[toc] | [prev] | [next] | [standalone]


#394429

FromJeroen Belleman <jeroen@nospam.please>
Date2016-01-18 22:34 +0100
Message-ID<n7jlpn$1irg$1@gioia.aioe.org>
In reply to#394427
On 18/01/16 22:30, Joerg wrote:
> On 2016-01-18 13:00, John Larkin wrote:
>> On Mon, 18 Jan 2016 12:49:09 -0800, Joerg <news@analogconsultants.com>
>> wrote:
[...]
>>> 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.
>

Oh! That's even better. I wasn't aware of that! Thanks Joerg!

Jeroen Belleman

[toc] | [prev] | [next] | [standalone]


#394444

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2016-01-18 15:46 -0800
Message-ID<05uq9bhar3vvpei5s8spnh31ak528s80l1@4ax.com>
In reply to#394427
On Mon, 18 Jan 2016 13:30:05 -0800, Joerg <news@analogconsultants.com>
wrote:

>>
>> 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.


I can't get that to work.


Version 4
SHEET 1 880 680
WIRE 80 64 48 64
WIRE 112 64 80 64
WIRE 288 64 176 64
WIRE 448 64 288 64
WIRE 48 112 48 64
WIRE 448 112 448 64
WIRE 176 128 176 64
WIRE 288 128 288 64
WIRE 48 240 48 192
WIRE 176 240 176 192
WIRE 288 240 288 208
WIRE 448 240 448 192
FLAG 48 240 0
FLAG 176 240 0
FLAG 288 240 0
FLAG 448 240 0
FLAG 80 64 VX
SYMBOL ind 272 112 R0
WINDOW 0 49 30 Left 2
WINDOW 3 57 72 Left 2
SYMATTR InstName L1
SYMATTR Value 1
SYMBOL cap 160 128 R0
SYMATTR InstName C1
SYMATTR Value 1
SYMBOL voltage 48 96 R0
WINDOW 0 -79 76 Left 2
WINDOW 3 -214 117 Left 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(10 1 2 20)
SYMBOL current 448 112 R0
WINDOW 0 44 56 Left 2
WINDOW 3 9 94 Left 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName I1
SYMATTR Value PULSE(1 0 1)
TEXT -128 113 Left 2 !.tran 25


I tried setting the value of C1 to  

{v(vx)}

and

v(vx)

and Spice complains. What am I doing wrong? Does it work for resistors
and not caps?

My old DOS simulator, ECA, would let you do anything.





-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#394445

FromJoerg <news@analogconsultants.com>
Date2016-01-18 16:10 -0800
Message-ID<dg5d83Fm7fhU1@mid.individual.net>
In reply to#394444
On 2016-01-18 15:46, John Larkin wrote:
> On Mon, 18 Jan 2016 13:30:05 -0800, Joerg <news@analogconsultants.com>
> wrote:
>
>>>
>>> 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.
>
>
> I can't get that to work.
>
>
> Version 4
> SHEET 1 880 680
> WIRE 80 64 48 64
> WIRE 112 64 80 64
> WIRE 288 64 176 64
> WIRE 448 64 288 64
> WIRE 48 112 48 64
> WIRE 448 112 448 64
> WIRE 176 128 176 64
> WIRE 288 128 288 64
> WIRE 48 240 48 192
> WIRE 176 240 176 192
> WIRE 288 240 288 208
> WIRE 448 240 448 192
> FLAG 48 240 0
> FLAG 176 240 0
> FLAG 288 240 0
> FLAG 448 240 0
> FLAG 80 64 VX
> SYMBOL ind 272 112 R0
> WINDOW 0 49 30 Left 2
> WINDOW 3 57 72 Left 2
> SYMATTR InstName L1
> SYMATTR Value 1
> SYMBOL cap 160 128 R0
> SYMATTR InstName C1
> SYMATTR Value 1
> SYMBOL voltage 48 96 R0
> WINDOW 0 -79 76 Left 2
> WINDOW 3 -214 117 Left 2
> WINDOW 123 0 0 Left 2
> WINDOW 39 0 0 Left 2
> SYMATTR InstName V1
> SYMATTR Value PULSE(10 1 2 20)
> SYMBOL current 448 112 R0
> WINDOW 0 44 56 Left 2
> WINDOW 3 9 94 Left 2
> WINDOW 123 0 0 Left 2
> WINDOW 39 0 0 Left 2
> SYMATTR InstName I1
> SYMATTR Value PULSE(1 0 1)
> TEXT -128 113 Left 2 !.tran 25
>
>
> I tried setting the value of C1 to
>
> {v(vx)}
>
> and
>
> v(vx)
>
> and Spice complains. What am I doing wrong? Does it work for resistors
> and not caps?
>
> My old DOS simulator, ECA, would let you do anything.
>

Caps need the charge specified, not C. But I had trouble getting that to 
work myself and we had a discussion about it here. Cranking up the time 
machine ... ah, here it is ... I believe you answered your own question 
early last year :-)

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc

-- 
Regards, Joerg

http://www.analogconsultants.com/

[toc] | [prev] | [next] | [standalone]


#394455

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2016-01-18 17:20 -0800
Message-ID<t23r9bd1h3iobir01vtebkl3oeojhp7mih@4ax.com>
In reply to#394445
On Mon, 18 Jan 2016 16:10:46 -0800, Joerg <news@analogconsultants.com>
wrote:

>On 2016-01-18 15:46, John Larkin wrote:
>> On Mon, 18 Jan 2016 13:30:05 -0800, Joerg <news@analogconsultants.com>
>> wrote:
>>
>>>>
>>>> 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.
>>
>>
>> I can't get that to work.
>>
>>
>> Version 4
>> SHEET 1 880 680
>> WIRE 80 64 48 64
>> WIRE 112 64 80 64
>> WIRE 288 64 176 64
>> WIRE 448 64 288 64
>> WIRE 48 112 48 64
>> WIRE 448 112 448 64
>> WIRE 176 128 176 64
>> WIRE 288 128 288 64
>> WIRE 48 240 48 192
>> WIRE 176 240 176 192
>> WIRE 288 240 288 208
>> WIRE 448 240 448 192
>> FLAG 48 240 0
>> FLAG 176 240 0
>> FLAG 288 240 0
>> FLAG 448 240 0
>> FLAG 80 64 VX
>> SYMBOL ind 272 112 R0
>> WINDOW 0 49 30 Left 2
>> WINDOW 3 57 72 Left 2
>> SYMATTR InstName L1
>> SYMATTR Value 1
>> SYMBOL cap 160 128 R0
>> SYMATTR InstName C1
>> SYMATTR Value 1
>> SYMBOL voltage 48 96 R0
>> WINDOW 0 -79 76 Left 2
>> WINDOW 3 -214 117 Left 2
>> WINDOW 123 0 0 Left 2
>> WINDOW 39 0 0 Left 2
>> SYMATTR InstName V1
>> SYMATTR Value PULSE(10 1 2 20)
>> SYMBOL current 448 112 R0
>> WINDOW 0 44 56 Left 2
>> WINDOW 3 9 94 Left 2
>> WINDOW 123 0 0 Left 2
>> WINDOW 39 0 0 Left 2
>> SYMATTR InstName I1
>> SYMATTR Value PULSE(1 0 1)
>> TEXT -128 113 Left 2 !.tran 25
>>
>>
>> I tried setting the value of C1 to
>>
>> {v(vx)}
>>
>> and
>>
>> v(vx)
>>
>> and Spice complains. What am I doing wrong? Does it work for resistors
>> and not caps?
>>
>> My old DOS simulator, ECA, would let you do anything.
>>
>
>Caps need the charge specified, not C. But I had trouble getting that to 
>work myself and we had a discussion about it here. Cranking up the time 
>machine ... ah, here it is ... I believe you answered your own question 
>early last year :-)
>
>https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc

The q=x*expression is a special case hack for capacitors, not a
general case. The only input voltage available is 'x', the voltage
across the cap itself, not some other node voltage.

I tried making a resistor value depend on a voltage and Spice wouldn't
let me do that. A behavioral current source could be forced to pretend
to be a programmed resistor, but that's not as nice as saying that r
equals (Vnn)

I can see that changing the value of a cap in real time has charge and
COE issues, but a resistor doesn't.


-- 

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement 

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#394510

FromJoerg <news@analogconsultants.com>
Date2016-01-19 07:30 -0800
Message-ID<dg734oF1nccU1@mid.individual.net>
In reply to#394455
On 2016-01-18 17:20, John Larkin wrote:
> On Mon, 18 Jan 2016 16:10:46 -0800, Joerg <news@analogconsultants.com>
> wrote:
>
>> On 2016-01-18 15:46, John Larkin wrote:
>>> On Mon, 18 Jan 2016 13:30:05 -0800, Joerg <news@analogconsultants.com>
>>> wrote:
>>>
>>>>>
>>>>> 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.
>>>
>>>
>>> I can't get that to work.
>>>
>>>
>>> Version 4
>>> SHEET 1 880 680
>>> WIRE 80 64 48 64
>>> WIRE 112 64 80 64
>>> WIRE 288 64 176 64
>>> WIRE 448 64 288 64
>>> WIRE 48 112 48 64
>>> WIRE 448 112 448 64
>>> WIRE 176 128 176 64
>>> WIRE 288 128 288 64
>>> WIRE 48 240 48 192
>>> WIRE 176 240 176 192
>>> WIRE 288 240 288 208
>>> WIRE 448 240 448 192
>>> FLAG 48 240 0
>>> FLAG 176 240 0
>>> FLAG 288 240 0
>>> FLAG 448 240 0
>>> FLAG 80 64 VX
>>> SYMBOL ind 272 112 R0
>>> WINDOW 0 49 30 Left 2
>>> WINDOW 3 57 72 Left 2
>>> SYMATTR InstName L1
>>> SYMATTR Value 1
>>> SYMBOL cap 160 128 R0
>>> SYMATTR InstName C1
>>> SYMATTR Value 1
>>> SYMBOL voltage 48 96 R0
>>> WINDOW 0 -79 76 Left 2
>>> WINDOW 3 -214 117 Left 2
>>> WINDOW 123 0 0 Left 2
>>> WINDOW 39 0 0 Left 2
>>> SYMATTR InstName V1
>>> SYMATTR Value PULSE(10 1 2 20)
>>> SYMBOL current 448 112 R0
>>> WINDOW 0 44 56 Left 2
>>> WINDOW 3 9 94 Left 2
>>> WINDOW 123 0 0 Left 2
>>> WINDOW 39 0 0 Left 2
>>> SYMATTR InstName I1
>>> SYMATTR Value PULSE(1 0 1)
>>> TEXT -128 113 Left 2 !.tran 25
>>>
>>>
>>> I tried setting the value of C1 to
>>>
>>> {v(vx)}
>>>
>>> and
>>>
>>> v(vx)
>>>
>>> and Spice complains. What am I doing wrong? Does it work for resistors
>>> and not caps?
>>>
>>> My old DOS simulator, ECA, would let you do anything.
>>>
>>
>> Caps need the charge specified, not C. But I had trouble getting that to
>> work myself and we had a discussion about it here. Cranking up the time
>> machine ... ah, here it is ... I believe you answered your own question
>> early last year :-)
>>
>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc
>
> The q=x*expression is a special case hack for capacitors, not a
> general case. The only input voltage available is 'x', the voltage
> across the cap itself, not some other node voltage.
>

In your example you have Q=X*V(ZZ) so the capacitance is dependent on 
the external node voltage ZZ.


> I tried making a resistor value depend on a voltage and Spice wouldn't
> let me do that. A behavioral current source could be forced to pretend
> to be a programmed resistor, but that's not as nice as saying that r
> equals (Vnn)
>

Don't use a current source, use the plain resistor.


> I can see that changing the value of a cap in real time has charge and
> COE issues, but a resistor doesn't.
>

Here is a resistor value depending in a voltage:

Version 4
SHEET 1 1036 680
WIRE 800 48 672 48
WIRE 800 64 800 48
WIRE -16 80 -16 32
WIRE 672 80 672 48
WIRE -16 192 -16 160
WIRE 672 192 672 160
WIRE 800 192 800 144
FLAG 800 192 0
FLAG -16 192 0
FLAG -16 32 X
FLAG 672 192 0
SYMBOL voltage -16 64 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(0.01 1 0 100m 100m 400m 1)
SYMBOL res 784 48 R0
SYMATTR InstName R1
SYMATTR Value R=(V(X))
SYMBOL current 672 80 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName I1
SYMATTR Value 1
TEXT -42 280 Left 2 !.tran 3

-- 
Regards, Joerg

http://www.analogconsultants.com/

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | sci.electronics.design


csiph-web