¿ªÔÆÌåÓý


Re: Pease tuneable MFB band-pass filter

 

Hi John, Could you update your zip of the circuit to .inc LM4562_NS.sub?Btw, it occurs to me because of this that a nice feature for LTspice would be to be able to simply change the opamp name on the schematic to UniversalOpAmp to avoid having to place it.
?
Tim


Re: Oddity in Behavioural Voltage Source

 

I can not change the answer been sent.
noticed.


Re: Oddity in Behavioural Voltage Source

 

if? 0< {AMP}*V(D1)<10,
?
G2 output {AMP}*V(D1), based on your params, this part is 10 times "higher" of amplitude value of the "source" D1.
?
I assume you did not divide 10 (AMP) when you probe the G2.


Re: Oddity in Behavioural Voltage Source

 

I did not notice if someone has already find the same as "reason".
?
you should probe the G2/10.
?
about the equation, V=limit({AMP}*V(D1), 0, 10)?
?
if? {AMP}*V(D1)<10,
?
if output {AMP}*V(D1), based on your params, this part is 10 times "higher" of amplitude value of the "source" D1.
?
I assume you did not divide 10 when you probe the G2.
?
?
?
?
?


Re: Cannot find models

 

Hi Ben,
?
You can always create your own symbol as a .asy file with the same name as the subckt. Here's the spice directive that I add to my schematic anytime I need a pot. Just make sure the .asy file is in the same folder as your schematic.
?
* This is the potentiometer
* ? ? ?_____
* ?1--|_____|--2
* ? ? ? ?|
* ? ? ? ?3
*
.SUBCKT potentiometer 1 2 3
.param w=limit(wiper,1m,.999)
R0 1 3 {Rtot*(1-w)}
R1 3 2 {Rtot*(w)}
.ENDS
?
Hope that helps,
Mike


Re: Cannot find models

 

On Thu, May 15, 2025 at 04:18 AM, <benmeulenbeld2007@...> wrote:
Hi, my name is Ben and I was looking for the 3pin POT model in your database.
There are many (MANY!) 3-pin potentiometer symbols and models that you can find, if you really desperately need one.? I almost never use a potentiometer symbol+model, because you don't need one.? A potentiometer is literally just two resistors connected in series.
?
But as I say, there are many potentiometer symbols already.? None of them come with LTspice because they are not needed, but dozens of LTspice users have created and uploaded their own symbols over the years.? For example, if you look in either of these two locations, you will find some of them:
?
Files > z_yahoo > Lib > Potentiometer
?
Files > z_yahoo > Tut > Potentiometer
?
I found well over 100 instances of "potentiometer" in our group's Files area, and that does not include those that were written as "pot" instead of the full name "potentiometer".
?
I found this link: . But I cannot open it.
That's because it is gone.? But you can find a saved copy of that website (and hopefully most of its contents) at the Wayback Machine, here:
https://web.archive.org/web/20190902113821/http://www.emwonder.com/spicemodels/
?
Andy
?


Re: Cannot find models

 

¿ªÔÆÌåÓý

On 15/05/2025 09:40, benmeulenbeld2007 via groups.io wrote:
Hi, my name is Ben and I was looking for the 3pin POT model in your database. I found this link: . But I cannot open it.
Can anyone help me?
thank you already.
The library you want (probably) is: potentiometer_standard.lib. Note: this only contains the models, not any symbols. But they are easy enough to make to your own needs.

Take time to read the model file to understand how to use it.

--
Regards,
Tony


Re: Cannot find models

 

¿ªÔÆÌåÓý

HI, Ben. Search in the group archives, the folders in Files which have 'z_,,,' names. You will find more than one model. for 'potentiometer'.? That emwonder site no longer exists.

On 2025-05-15 08:40, benmeulenbeld2007 via groups.io wrote:
Hi, my name is Ben and I was looking for the 3pin POT model in your database. I found this link: . But I cannot open it.
Can anyone help me?
thank you already.
?
-Ben
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Cannot find models

 

Hi, my name is Ben and I was looking for the 3pin POT model in your database. I found this link: . But I cannot open it.
Can anyone help me?
thank you already.
?
-Ben


Re: simulating CD4007 (CD4009 ??) for linear application

 

On Wed, May 14, 2025 at 08:28 PM, <Eli.rosenkim@...> wrote:
Good catch with the square wave, I noticed that right after posting. In any case the simulation results I was getting had to do more with horrible control leakage (louder than the input audio signal!) than with distortion. ...
I don't remember if I said this or if I edited it out of my reply.? I think the circuit may have been intended as a volume control, where the control voltage changes very slowly or not at all.? In that case, the RC filter they used was probably sufficient.? Because it has considerable feed-through from the control input to the output, it would not go well if the control voltage can change in less than a second, as you noticed.? I suspect it is fundamental to the circuit, not dependent on the transistor models.? It varies the supply voltage to the output transistors and I think it can't help but go straight into the output.
?
Or, if this was for an electronic music synthesizer, the leakage might be treated as part of the overall sound effect, warts and all.
?
I somewhat doubt there is a good way to actually reduce it, except with a balanced topology that provides cancellation, which is probably more than you can do with a CD4009.
?
A very long time ago I lived within miles of Bernie Hutchins of Electronotes, but did not know it.? Maybe our paths crossed.
?
Andy
?


Re: simulating CD4007 (CD4009 ??) for linear application

 

Good catch with the square wave, I noticed that right after posting. In any case the simulation results I was getting had to do more with horrible control leakage (louder than the input audio signal!) than with distortion. Thank you for the tip with the W and L parameters, I may give that a try although it looks like eetech00 has uploaded a simulation so I might be lazy?

Re: Electronotes, still the only place to learn most of this stuff in any sort of depth unfortunately, although Aaron Lanterman's courses cover a lot of the introductory material really well. A shame how strange Bernie is about distribution, I am lucky enough to attend a college that has a bound copy.


Re: simulating CD4007 (CD4009 ??) for linear application

 

Sweet! thank you, I will give those a try. :)


Re: simulating CD4007 (CD4009 ??) for linear application

 

Hi
?
In the event use still want to try the CD4009UB, I'm uploading a model, and a model for the CD4010B.
Both are transistor based models.
?
eT


Re: Oddity in Behavioural Voltage Source

 

Thanks Andy,
that is interesting to know. I'll experiment more with the integration settings. Also, thanks for cleaning up my upload and the info on naming the signals. I'll be more considerate in the future about both of these things.?

I'm overwhelmed by the immediacy of help and expertise I'm getting here.
?
Thanks again an cheers,
Joerg
?


Re: Oddity in Behavioural Voltage Source

 

¿ªÔÆÌåÓý

On 14/05/2025 16:36, Andy I via groups.io wrote:
On Wed, May 14, 2025 at 09:58 AM, Tony Casey wrote:
  1. .TRAN 200u, no other settings: 25kB
Interesting.? Joerg's own .raw file with the same settings was 2.2 MB, almost 100 times bigger.? Well, we don't know what all the settings were, and he used the MacOS version of LTspice, about which I know very little.
?
I was surprised that his .raw file was as large as it was, since the timesteps were spread out in places.
The MacOS version of LTspice is pretty much an unknown to me. I didn't know what analysis time Joerg used. I plucked 200¦Ìs out of the air for my use, and my schematic was minimalist - Joerg's had other stuff on it.

--
Regards,
Tony


Re: Oddity in Behavioural Voltage Source

 

On Wed, May 14, 2025 at 09:58 AM, Tony Casey wrote:
  1. .TRAN 200u, no other settings: 25kB
Interesting.? Joerg's own .raw file with the same settings was 2.2 MB, almost 100 times bigger.? Well, we don't know what all the settings were, and he used the MacOS version of LTspice, about which I know very little.
?
I was surprised that his .raw file was as large as it was, since the timesteps were spread out in places.
?
Andy
?


Re: Oddity in Behavioural Voltage Source

 

Joerg,
?
There is one other thing that needs to be said, because your simulated time points were too far apart.? I almost forgot about this, but it is important here and helps explain the discrepancy you saw.
?
In your Mac LTspice settings, do you have it set to "Default Integration Method = Modified Trap"?? Until recently, that was the default setting in LTspice, and I assume it is the setting you had.
?
"Modified Trap" does interesting things to some signals, particularly to fast-changing signals.? V(G2) counts as one of those.? Your other LTspice settings might differ from mine because I can't replicate the same signals you had, but I am using LTspice on a Windows PC and that may be part of the difference.? (Or perhaps the schematic you uploaded is not the same one you used when making your plot.)
?
The Modified Trap algorithm applies nonlinear smoothing around triads of timepoints.? The result is that the saved and plotted waveform V(G2) could have started to "move" one timestep before V(G2) actually changed.? It may be puzzling why LTspice would do that, but it is key to the "Modified Trap" algorithm which essentially eliminates almost all traces of what is called "Trap Ringing" or "Trap Oscillation".? It is a trade-off.? In exchange for eliminating trap ringing, you get waveforms where very sharp edges become "bent" or S-shaped, and the start and end of each fast edge has been pushed outwards a little bit in time.
?
That is probably why your plotted V(G2) seems to be switching already, before V(D1) has yet crossed 0 V.? ?I can't replicate that on my PC, but maybe it is a characteristic of the MaxOS version you use.
?
Adding the smaller Maximum Timestep greatly helps.? It keeps the waveforms in step with reality better.
?
Changing LTspice's settings from "Modified Trap" to "Trapezoidal" also should eliminate the apparent problem, but in return, you would start to see cases of "Trap Ringing" which can be quite annoying.
?
Andy
?
?


Re: Oddity in Behavioural Voltage Source

 

¿ªÔÆÌåÓý

On 14/05/2025 12:03, joerg via groups.io wrote:
But I'm still confused about the inner workings of LTSpice then: If I define a voltage source to behave like a function of another voltage, shouldn't the timing of the points align?

In other words, if V(D1) is known at time t, why is LTSpice calculating V(G1) = limit(10 V(D1), 0, 10) at some other time? In the plot, one can clearly see V(D1) being negative and V(G2) already being positive, and that should never happen under this function.
(/g/LTspice/photo/302449/3916346?p=Created%2C%2C%2C20%2C2%2C0%2C0)

Thanks for any insights!
No, it doesn't quite work like that. LTspice doesn't know a priori when a waveform will touch a certain voltage. It solves each point in time independently, and then guesses what the next time point should be based on what previous activity there was and what restrictions have been placed on error limits. Nothing is exact! The data points in all traces will align in time, but not necessarily at what might be the obviously voltages to you (knowing the transfer function).

Something else happens too. Even with the inexact timings of each data point, LTspice also limits the number of data points it stores, based on what it thinks reasonably preserves the wave shape. This is data compression, intended to reduce the size of the .raw file, which contains all the data point of every voltage and current waveform, whether viewed or not. You can turn this feature off if waveform fidelity is critical for what you are doing, like this:

.option plotwinsize=0 (no data compression)

You can refer to the Help for more information on this.

If you want exact timing information, there are a few things that can help. The first is as I originally suggested: set a maximum time step. This with this is that it uses that maximum step throughout the analysis, whether needed or not.

The other possibility, when arbitrary sources are used like your example. You can set the maximum step voltage allowed within a fixed time, which overrides LTspice's default setting (set as B-source parameters). LTspice will reject a data point if the voltage step exceeds that limit and wind in the time step until the corresponding voltage step falls below the limit you specified. In, principle you can retain the accuracy without overly increasing the size the .raw file.

So, in a small test circuit consisting only of the sine V-source and the arbitrary B-source, different setting give different .raw file sizes:

  1. .TRAN 200u, no other settings: 25kB
  2. .TRAN 0 200u 0 1n: 21.3kB
  3. .TRAN 200u, no data compression: 25.4kB
  4. .TRAN 0 200u 0 1n, no data compression: 4.6MB
  5. .TRAN 0 200u 0 10n, no data compression: 470kB
  6. .TRAN 200u, Tripdv=10m Tripdt=10n, no data compression: 631kB
Changing any of the settings in Control Panel > SPICE will also change the outcome.

You have lots of control over how accurate you want your results to be. There are trade-offs: .raw file size, analysis time.

--
Regards,
Tony


Re: Oddity in Behavioural Voltage Source

 

On Wed, May 14, 2025 at 08:54 AM, joerg wrote:
But I'm still confused about the inner workings of LTSpice then: If I define a voltage source to behave like a function of another voltage, shouldn't the timing of the points align?
I think? you understand LTspice correctly, but you may not understand the amplifiers you used.
?
The clipping amplifier, U2, does not respond until its input signal V(BufferOut) crosses the input offset voltage of U2, which might then be followed by the propagation delay of U2, since op-amps can never respond instantaneously.? That is further compounded by the fact that U2 was pushed hard into clipping, and many op-amps take a discrete time to recover from being pushed so hard into clipping.? The result is that the output of U2 did not actually begin to "switch" until well after its input signal crosses 0V.
?
Whereas, the behavioral source has no such restrictions.? It has zero offset voltage, no delay (unless you give it one), and needs no time to recover from over-drive.
?
Tony is correct that the simulation needed a smaller Maximum Timestep.? Without it, the outputs from the simulation went slightly out of control in this case.? It is unusual for it to have happened the exact way that it did here, with the high voltage gains of the two op-amps who did not know what was about to hit them hard.? The simulation had a relaxed internal timestep up until the clipping amp was already being pushed to switch the other way, so its simulated output voltage "missed" the chance to switch where it should have - until the Maximum Timestep was made small enough.
?
By the way, it is not normal to label your + supply voltage "VSS".? "VSS" is traditionally reserved for the most negative supply voltage, and "VDD" is the most positive supply voltage - at least when circuits use FETs.? Their counterpart names in bipolar circuits were VEE and VCC.? You can of course name them anything you want, but you might want to follow the "norms" that other people use.? Otherwise confusion is likely.
?
Also by the way, LTspice is spelled "LTspice".? It is not "LTSpice".
?
Please read the group's main webpage again.? It appears you did not know about attaching files, about uploading photos, and about uploading schematic filles.? I also "fixed" the file you uploaded because you included other files inside the ZIP which you should not have included.? Read the group's guidelines carefully and please follow them.
?
I fixed the file you uploaded.? You included many files inside the ZIP that should not have been there.
?
Andy
?


Re: Oddity in Behavioural Voltage Source

 

Hi John,
?
the odd setup is from the fact that I had played with different op amps, the first acting as buffer and the second doing the amplification. The op amp in the schematic is not unity gain stable, so I moved some of the gain to the buffer stage. That is silly of course, but pls. don't concern yourself with that, the real issue was the odd behaviour of the behavioural voltage source and Tony's comment on the timesteps fixed it.
?
Best,
Joerg
?