¿ªÔÆÌåÓý

Date

Step a resistor over time

 

Hi All, is it possible to step a resistor over time? Right now if I use the step command like this:

.step param R 100 1000 100
.tran 0 1ms 0 1

I
end up with a bunch of parallel horizontal lines. What I want is a
bunch of points (maybe even connected) over time. So in other words,
over the 1ms, I want the resistance to step from 100 to 1000. Is it
possible?

Thanks!
Richard


Re: THD

 

Indeed, I found 25*(D/T)^2 by trial.
Running simulations that gave me THD values for various D values.
I have uploaded the .asc file of that simulaton.

"enable" is a spelling mistake. I meant "unable".

I did try using Fourier analysis in my manual calculations. Calculation of the Fourrier coefficient is extremly difficult,
this is why I tried a workaround.
I am puzzled to see such a complex calculation while the THD = 25*( D/T )^2 result is so simple. This result fits so well with simuulation trials, I doubt it is so by chance.

--- In LTspice@..., John Woodgate <jmw@...> wrote:

In message <kkckve+t28o@...>, dated Sat, 13 Apr 2013, Echidna
<mchambin@...> writes:

Using LTspice simulations I find THD = 25*( D/T )^2 In this simulation
I used a 1000 HZ SINE combined with a PULSE with values of D like 0.1u
0.2u 0.5u 1u 2u 5u 10u 20u 50u These simulations gave me a THD that
perfectly fits with 25*( D/T )^2
I think you mean you found 25*(D/T)^2 by trial. This can be misleading.
I once found a power function that matches half a sine wave very
accurately, but outside the range 0 to pi it doesn't.

Here is the issue.
I was enable to prove this result with maths
'unable', I think.

(instead of simulations ).
I started computing the RMS value of the error signal (the dents at the
crossovers) With sin omega*t = omega*t ( valid for t << T ) I don' t
get the 25*( D/T )^2 result, I do get a fonction of D/T, so far so
good, but I don't get the right exponant. It seems my approach is wrong.
The function you do get might match 25*(D/T)^2 over a range of D/T.

Is there a signal theory / maths guru who can give the proof that for
such a signal S(t) ( with D << T ) we have THD = 25*( D/T )^2
Did you try using Fourier analysis in you manual calculations?
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK


Re: Photo Transistor

 

--- In LTspice@..., Andy <Andrew.Ingraham@...> wrote:

I am new to LTspice and electricity(my dad is my teacher), I was looking on
google how to add a photo transistor. The only useful thing I found was to add
a Photo coupler. I tried this in a circuit with a n-Channel mosfet and it was
successful. But when I want to change the parameters of the Photo coupler
it gives me a notification it is not possible. How can I override this?
This is likely a MS-Windows problem, but you haven't given us nearly
enough information to say for sure.

You probably put a file in a directory owned by Windows (perhaps a
subdirectory of C:/Program Files/ where the LTspice program itself
is), and Windows doesn't let you modify it. Morale: Never put your
schematics, models, symbols, subcircuits, or netlists under the
Program Files folder.

If your interpretation of "it is not possible" differs from mine, then
maybe I am not on the right track. If so, you will have to give us a
lot more information. Or, upload your file(s) as instructed on this
group's main page and show us what didn't work.

Regards,
Andy
Dear Andy,

Thx. for your reply, I indeed saved the library files under program files. When I right click on the photo coupler it gives me following message "High density mounting photo coupler This component cannot be edited". The strange thing is that all other components can be edited and they are saved in the same library. I will upload the file on the group main page to make it more clear.

Many thx. for your feedback,

KR,

Renato


Re: inverting opamp simulation: rapid component variation

John Woodgate
 

In message <kkdlr2+p199@...>, dated Sun, 14 Apr 2013, MOHAMMAD A MAKTOOMI <amaktoomamu@...> writes:

Actually, a DC input voltage is present. But, I don't know if it will be ground in AC analysis.
It will be ignored, which is equivalent.

If that's grounded then how could I have output (ignore offsets at this moment).
I don't see a solution if R2 varies at frequencies as high as the op-amp will handle. If R2 varies more slowly (*), you could put in a sine wave signal at a higher frequency to act purely as a 'carrier' which is amplitude modulated by the variation of R2. Your output would then be the peak-detected and filtered carrier.

(*) However rapidly R2 might vary in reality, you can always slow it down for simulation, e.g. using a frequency range of 0.1 Hz to 1000 Hz with a 10 kHz carrier. Obvious, you need to simulate for several tens of seconds in such a case.
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK


Re: THD

John Woodgate
 

In message <kkckve+t28o@...>, dated Sat, 13 Apr 2013, Echidna <mchambin@...> writes:

Using LTspice simulations I find THD = 25*( D/T )^2 In this simulation I used a 1000 HZ SINE combined with a PULSE with values of D like 0.1u 0.2u 0.5u 1u 2u 5u 10u 20u 50u These simulations gave me a THD that perfectly fits with 25*( D/T )^2
I think you mean you found 25*(D/T)^2 by trial. This can be misleading. I once found a power function that matches half a sine wave very accurately, but outside the range 0 to pi it doesn't.

Here is the issue.
I was enable to prove this result with maths
'unable', I think.

(instead of simulations ).
I started computing the RMS value of the error signal (the dents at the crossovers) With sin omega*t = omega*t ( valid for t << T ) I don' t get the 25*( D/T )^2 result, I do get a fonction of D/T, so far so good, but I don't get the right exponant. It seems my approach is wrong.
The function you do get might match 25*(D/T)^2 over a range of D/T.

Is there a signal theory / maths guru who can give the proof that for such a signal S(t) ( with D << T ) we have THD = 25*( D/T )^2
Did you try using Fourier analysis in you manual calculations?
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK


Re: inverting opamp simulation: rapid component variation

 

Hello John,

Actually, a DC input voltage is present. But, I don't know if it will be ground in AC analysis.If that's grounded then how could I have output (ignore offsets at this moment).

--- In LTspice@..., John Woodgate <jmw@...> wrote:

In message <kkdb2u+pa7l@...>, dated Sun, 14 Apr 2013, MOHAMMAD A
MAKTOOMI <amaktoomamu@...> writes:

Here, I don't have any such thing (as I wish to vary the frequency of
R2, NOT that of any source), so how do I proceed?
Varying the value of R2, with no other input signal, doesn't produce any
output, unless it's from DC offset voltage or current, or noise. You can
add offset and/or noise voltage and current generators at the input and
run, but only by using .TRAN. Time does not exist in an .AC or AC sweep
analysis.
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK


Re: inverting opamp simulation: rapid component variation

John Woodgate
 

In message <kkdb2u+pa7l@...>, dated Sun, 14 Apr 2013, MOHAMMAD A MAKTOOMI <amaktoomamu@...> writes:

Here, I don't have any such thing (as I wish to vary the frequency of R2, NOT that of any source), so how do I proceed?
Varying the value of R2, with no other input signal, doesn't produce any output, unless it's from DC offset voltage or current, or noise. You can add offset and/or noise voltage and current generators at the input and run, but only by using .TRAN. Time does not exist in an .AC or AC sweep analysis.
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK


Re: inverting opamp simulation: rapid component variation

 

Thank you, Andy for your hints.
But, in '.AC' we need to have an AC voltage or current source. Here, I don't have any such thing (as I wish to vary the frequency of R2, NOT that of any source), so how do I proceed?

--- In LTspice@..., Andy <Andrew.Ingraham@...> wrote:

MOHAMMAD A MAKTOOMI <amaktoomamu@...> wrote:

...
Note: In your circuit, you may need to decrease the maximum timestep
down to about 10ns. (.tran 0 0.1m 0 10n) The output waveform is
highly distorted at the highest frequency and LTspice was missing the
narrow peak before doing that, making the amplitude look a lot less.

It probably also means the result is unrealistic at that frequency,
but that's another matter.

Andy


Re: inverting opamp simulation: rapid component variation

 

MOHAMMAD A MAKTOOMI <amaktoomamu@...> wrote:

...
Note: In your circuit, you may need to decrease the maximum timestep
down to about 10ns. (.tran 0 0.1m 0 10n) The output waveform is
highly distorted at the highest frequency and LTspice was missing the
narrow peak before doing that, making the amplitude look a lot less.

It probably also means the result is unrealistic at that frequency,
but that's another matter.

Andy


Convergence problems with imported Pspice models

 

Janiel Feng <m_zhao12@...> wrote:

I imported models from Pspice to LTspice from TI and Analog Devices. But most
of them have Convergence Problem. Is there anybody know how to solve this problem?
First, try some of the FAQ files located here:

Files > FAQ
()

In particular, look at "Simulator_options.txt". Also look at
"faq_14.txt" and search for "convergence".

Andy


Re: inverting opamp simulation: rapid component variation

 

Janiel Feng <m_zhao12@...> wrote:

I imported models from Pspice to LTspice from TI and Analog Devices. But most
of them have Convergence Problem. Is there anybody know how to solve this problem?
You should have created a new message topic with its own Subject,
rather than hijacking someone else's question.

Response forthcoming with a new Subject line.

Andy


Re: inverting opamp simulation: rapid component variation

Janiel Feng
 

Hi,

I imported models from Pspice to LTspice from TI and Analog Devices. But most
of them have Convergence Problem. Is there anybody know how to solve this problem?

Thanks.

Janiel

--- On Sat, 4/13/13, Andy <Andrew.Ingraham@...> wrote:

From: Andy <Andrew.Ingraham@...>
Subject: Re: [LTspice] Re: inverting opamp simulation: rapid component variation
To: LTspice@...
Date: Saturday, April 13, 2013, 8:13 PM
















?









> Hello Helmut. Thank you for your example. I have no issue in performing transient.

Question is how do I simulate this behavior in terms of frequency response.


The quickest way to get a frequency response is to use an .AC

analysis, rather than .TRANsient. Then you can sweep and plot output

amplitude versus frequency.



The thing to always remember about .AC analysis, is that it is a

"small-signal" analysis, and the entire circuit is first linearized at

the operating point. If there is anything nonlinear in your circuit,

its effects would be ignored.



For the op-amp circuit, if you want to see the response from resistor

R2 to the output, that should work. But if you want to do something

like look at the frequency response between the source VDC and the

output, while R2 varies sinusoidally, that would not work because R2

modulates the response, i.e., its effect on VDC (and vice-versa) would

be nonlinear.



The other possible problem with .AC analysis is getting a modulated

resistance that works in AC analysis too.



Sometimes you just need to use a transient analysis. Then you can use

the .STEP command to vary the frequency in steps.



Andy

























[Non-text portions of this message have been removed]


Re: inverting opamp simulation: rapid component variation

 

Dear Michael, Thanks.
Of course example but Helmut make sense (a modified version is here: ) in time domain.

But, I don't want to be in time-domain. All I wish is a frequency domain plot.
Also, expressing R2 as R2(f) is perhaps not suitable in my case. one doesn't write for example, a sinusoid voltage as V(f) because sinusoid is a single frequency signal. so consider R2 as a single frequency 'signal'.
Just as you plot Bode to know how the output voltage changes as the frequency of input voltage changes, I wish to know how the output will changes if the frequency of variation of R2 changes.

I have gone through many books on circuit analysis; they all talk in terms of input/ouput as a voltage or current signal.

--- In LTspice@..., Michael Peter Kiwanuka <michael883575@...> wrote:

Hi Maktoomi

Helmut example is absolutely right. This is because a quick analysis of the circuit you have given shows the following:-

Vo/Vin = R2(f)/R1 . It follows that Vo= [R2(f)/Rin]*Vin = Iin*R2(f)

Now Vo = Iin*R2(f) shows the variation of the output with increasing frequency for a simulation time of 100mS. It does not take a lot of imagination to deduce that if your inverting amplifier can be represented by a single exponential lag, Vo will follow the response shown by Helmut's example and then its envelope will roll off at 20dB per decade at high frequencies at the half power point. You can sketch this manually when you know the frequency response of the inverting amplifier you want to use from the data sheet. (refer to Bode). Once you define your R2 the rest is easy.

Best regards,

Michael P Kiwanuka




To: LTspice@...
From: amaktoomamu@...
Date: Sat, 13 Apr 2013 16:46:27 +0000
Subject: [LTspice] Re: inverting opamp simulation: rapid component variation






Hello Helmut. Thank you for your example. I have no issue in performing transient. Question is how do I simulate this behavior in terms of frequency response.
I want to see how output varies if the rate of variation of R2 keeps on increasing. So, I wish to get a plot Vout vs frequency, where frequency shows the rate of fluctuation of R2.
Higher the frequency on horizontal scale, more rapid the variation in the value of R2.

Any help/suggestions would be greatly appreciated. (This is a part of a paper that I aim at submitting in conference).

PS: I have posted similar question in edaboard to get help in manual analysis of this problem.( more details: )

--- In LTspice@..., "Helmut" <helmutsennewald@> wrote:



--- In LTspice@..., "MOHAMMAD A MAKTOOMI" <amaktoomamu@> wrote:


Hi,
In an inverting amplifier(Uploaded File:
),
suppose R2 fluctuates very rapidly (say at 10KHz or even
higher, may be due to some environmental condition).
How do I simulate this behavior, given input is some fixed
dc voltage and opamp is 741 type (I have not attached any
specific opamp model so far, use what you have).
I am basically interested in perhaps frequency response-
I want to see how output varies if rate of variation of R2
keeps increasing.

Hello,

I have uploaded an example with a time-variable resistance.

R=1k+5k*(V(ctrl)+1)

Files > Temp > ni-opamp_.asc

Best regards,
Helmut





[Non-text portions of this message have been removed]


Re: inverting opamp simulation: rapid component variation

 

Hello Helmut. Thank you for your example. I have no issue in performing transient.
Question is how do I simulate this behavior in terms of frequency response.
The quickest way to get a frequency response is to use an .AC
analysis, rather than .TRANsient. Then you can sweep and plot output
amplitude versus frequency.

The thing to always remember about .AC analysis, is that it is a
"small-signal" analysis, and the entire circuit is first linearized at
the operating point. If there is anything nonlinear in your circuit,
its effects would be ignored.

For the op-amp circuit, if you want to see the response from resistor
R2 to the output, that should work. But if you want to do something
like look at the frequency response between the source VDC and the
output, while R2 varies sinusoidally, that would not work because R2
modulates the response, i.e., its effect on VDC (and vice-versa) would
be nonlinear.

The other possible problem with .AC analysis is getting a modulated
resistance that works in AC analysis too.

Sometimes you just need to use a transient analysis. Then you can use
the .STEP command to vary the frequency in steps.

Andy


Re: inverting opamp simulation: rapid component variation

 

Hi Maktoomi

Helmut example is absolutely right. This is because a quick analysis of the circuit you have given shows the following:-

Vo/Vin = R2(f)/R1 . It follows that Vo= [R2(f)/Rin]*Vin = Iin*R2(f)

Now Vo = Iin*R2(f) shows the variation of the output with increasing frequency for a simulation time of 100mS. It does not take a lot of imagination to deduce that if your inverting amplifier can be represented by a single exponential lag, Vo will follow the response shown by Helmut's example and then its envelope will roll off at 20dB per decade at high frequencies at the half power point. You can sketch this manually when you know the frequency response of the inverting amplifier you want to use from the data sheet. (refer to Bode). Once you define your R2 the rest is easy.

Best regards,

Michael P Kiwanuka




To: LTspice@...
From: amaktoomamu@...
Date: Sat, 13 Apr 2013 16:46:27 +0000
Subject: [LTspice] Re: inverting opamp simulation: rapid component variation






Hello Helmut. Thank you for your example. I have no issue in performing transient. Question is how do I simulate this behavior in terms of frequency response.
I want to see how output varies if the rate of variation of R2 keeps on increasing. So, I wish to get a plot Vout vs frequency, where frequency shows the rate of fluctuation of R2.
Higher the frequency on horizontal scale, more rapid the variation in the value of R2.

Any help/suggestions would be greatly appreciated. (This is a part of a paper that I aim at submitting in conference).

PS: I have posted similar question in edaboard to get help in manual analysis of this problem.( more details: )

--- In LTspice@..., "Helmut" <helmutsennewald@...> wrote:



--- In LTspice@..., "MOHAMMAD A MAKTOOMI" <amaktoomamu@> wrote:


Hi,
In an inverting amplifier(Uploaded File:
),
suppose R2 fluctuates very rapidly (say at 10KHz or even
higher, may be due to some environmental condition).
How do I simulate this behavior, given input is some fixed
dc voltage and opamp is 741 type (I have not attached any
specific opamp model so far, use what you have).
I am basically interested in perhaps frequency response-
I want to see how output varies if rate of variation of R2
keeps increasing.

Hello,

I have uploaded an example with a time-variable resistance.

R=1k+5k*(V(ctrl)+1)

Files > Temp > ni-opamp_.asc

Best regards,
Helmut





[Non-text portions of this message have been removed]


Re: Photo Transistor

 

I am new to LTspice and electricity(my dad is my teacher), I was looking on
google how to add a photo transistor. The only useful thing I found was to add
a Photo coupler. I tried this in a circuit with a n-Channel mosfet and it was
successful. But when I want to change the parameters of the Photo coupler
it gives me a notification it is not possible. How can I override this?
This is likely a MS-Windows problem, but you haven't given us nearly
enough information to say for sure.

You probably put a file in a directory owned by Windows (perhaps a
subdirectory of C:/Program Files/ where the LTspice program itself
is), and Windows doesn't let you modify it. Morale: Never put your
schematics, models, symbols, subcircuits, or netlists under the
Program Files folder.

If your interpretation of "it is not possible" differs from mine, then
maybe I am not on the right track. If so, you will have to give us a
lot more information. Or, upload your file(s) as instructed on this
group's main page and show us what didn't work.

Regards,
Andy


THD of a sine with a small dent at crossover

 

Hello.
How to calculate, using maths and definitions, the THD of this signal: A sine with a small dent at the crossovers.

S(t) = 0 for 0 < t < D where D is much smaller than T
S(t) = sin omega*t for D < t < T/2 where omega is 2*pi/T
S(t) = 0 for T/2 < t < T/2 + D
S(t) = sin omega*t for T/2 + D < t < T

Using LTspice simulations I find THD = 25*( D/T )^2
In this simulation I used a 1000 HZ SINE combined with a PULSE with values of D like 0.1u 0.2u 0.5u 1u 2u 5u 10u 20u 50u
These simulations gave me a THD that perfectly fits with 25*( D/T )^2

Here is the issue.
I was enable to prove this result with maths
(instead of simulations ).
I started computing the RMS value of the error signal (the dents at the crossovers)
With sin omega*t = omega*t ( valid for t << T )
I don' t get the 25*( D/T )^2 result, I do get a fonction of D/T, so far so good, but I don't get the right exponant. It seems my approach is wrong.

Is there a signal theory / maths guru who can give the proof that for such a signal S(t) ( with D << T ) we have THD = 25*( D/T )^2


Photo Transistor

 

Dear all,

I am new to LTspice and electricity(my dad is my teacher), I was looking on google how to add a photo transistor. The only useful thing I found was to add a Photo coupler. I tried this in a circuit with a n-Channel mosfet and it was successful. But when I want to change the parameters of the Photo coupler it gives me a notification it is not possible. How can I override this?

Many thx. for your feedback,

Kr,

Renato


Re: inverting opamp simulation: rapid component variation

 

Hello Helmut. Thank you for your example. I have no issue in performing transient. Question is how do I simulate this behavior in terms of frequency response.
I want to see how output varies if the rate of variation of R2 keeps on increasing. So, I wish to get a plot Vout vs frequency, where frequency shows the rate of fluctuation of R2.
Higher the frequency on horizontal scale, more rapid the variation in the value of R2.

Any help/suggestions would be greatly appreciated. (This is a part of a paper that I aim at submitting in conference).

PS: I have posted similar question in edaboard to get help in manual analysis of this problem.( more details: )

--- In LTspice@..., "Helmut" <helmutsennewald@...> wrote:



--- In LTspice@..., "MOHAMMAD A MAKTOOMI" <amaktoomamu@> wrote:


Hi,
In an inverting amplifier(Uploaded File:
),
suppose R2 fluctuates very rapidly (say at 10KHz or even
higher, may be due to some environmental condition).
How do I simulate this behavior, given input is some fixed
dc voltage and opamp is 741 type (I have not attached any
specific opamp model so far, use what you have).
I am basically interested in perhaps frequency response-
I want to see how output varies if rate of variation of R2
keeps increasing.

Hello,

I have uploaded an example with a time-variable resistance.

R=1k+5k*(V(ctrl)+1)

Files > Temp > ni-opamp_.asc

Best regards,
Helmut


Re: Tutorial version of Joule-Thief

John Woodgate
 

In message <kkbun5+ctqn@...>, dated Sat, 13 Apr 2013, Tim <thutches@...> writes:

I just uploaded a another copy of the JT, because I wnat to use it as a techng aid to introduce a family member to some EE concepts and LTspice. He just graduated high school and has no exposure but a lot of interest in electronics.
Too late! You need to start at Grade 2 or earlier. (;-)

So having read the recent thread on the JT, I though it might be an excellent resource for him as it exposes transistor and switching theory and a lot of concepts in an easy to understand project that he can build and use my lab tools to verify the expected behavior.
It may be me, but I don't find non-linear oscillators at all simple.

In my posted version, derived from , I tried to added a second circuit to compare the effects of using a different transistor than the B549 in the reference article and I attempted to estimate the Joules being consumed (atfter all it is a Joule Thief.

If anyone cares to comment on how I might do this better (for the intended purpose), please do so.
I favour sine-waves and audio frequencies, but we are all different.
--
OOO - Own Opinions Only. See www.jmwa.demon.co.uk
They took me to a specialist burns unit - and made me learn 'To a haggis'.

John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK