开云体育

Date

.STEPping a .WAVE file output

 

开云体育

I want make multiple runs of a model which will output? a waveform to a .wav file.

Each run will step a parameter, all of which works as intended, except, I need to change the filename each time.

This illustrates the intent, but not? surprisingly, errors off on the last line:

?

.step param stp 1 6 1

.param Vcon table({stp}, 1,-2, 2, -1, 3, 0, 4, 1, 5, 2, 6,3)

.wave {Stp}.wav 16 44.1k V(Out)

?

Any suggested better syntax? I’ve tried several…

Thanks!

?

Dave

?


Re: LTspice AKO

 

Unfortunately, in this specific case it is screwed up. It's a bug that will be fixed in 24.1.6 (coming this week).
?
Best Regards,
Mathias
?
On Mon, Mar 24, 2025 at 09:55 AM, Tony Casey wrote:

On 24/03/2025 00:32, Andy I via groups.io wrote:
If I remember correctly, LTspice 24 v24.1.* screwed around with (messed up) AKO.? Since you are using v24.1.5, those errors might be a side-effect of that.
?
You could run an experiment (probably a DC sweep) to see if it picked up the NJ20 model, or if it fell back to the standard NJF model with defaults.
To clear, V24.1.x didn't screw up the AKO feature, as such - it still worked. The actual problem was with the model name not being recognised when AKO was being used with the resulting numeric "name" that was being .STEPed.

--
Regards,
Tony

?


Re: LTspice AKO

 

开云体育

On 24/03/2025 00:32, Andy I via groups.io wrote:
If I remember correctly, LTspice 24 v24.1.* screwed around with (messed up) AKO.? Since you are using v24.1.5, those errors might be a side-effect of that.
?
You could run an experiment (probably a DC sweep) to see if it picked up the NJ20 model, or if it fell back to the standard NJF model with defaults.
To clear, V24.1.x didn't screw up the AKO feature, as such - it still worked. The actual problem was with the model name not being recognised when AKO was being used with the resulting numeric "name" that was being .STEPed.

--
Regards,
Tony



Re: LTspice AKO

 

开云体育

On 24/03/2025 00:18, eetech00 via groups.io wrote:
The simulation runs but I'm not confident its using the proper JFET parameters because it doesn't show them when it produces the error. It may be using JFET defaults.
It works in 24.1.4 and 24.0.12. In 24.1.4, you get an error message in the logfile, but it still works. I don't have 24.1.5 installed yet. The NJF() is superfluous. You already have defined NJ20 as an NFT.
Yes, I know. But I had to that for BJT AKO to work so I tried useing it here.
Do you have braces in the instantiation? Try removing them. There are plenty of nuances here.
Already did. Doesn't help.
I had already checked that it does work even when an error is reported. 24.1.4 gave the same current as 24.0.12 in a .OP analysis, even when it reported the error. I doubled-checked by changing one of NJ20 model parameters (Beta) - the current changed accordingly. The result was the same whether or not the actual original model was used or the AKO name.

The error is being wrongly reported. Errors should be terminal, preventing analysis. If that doesn't happen, it should be reported as a warning, if "strict" syntax rules are not being followed. The classic "questionable curly braces" warning doesn't (normally) seem to affect the analysis.

I don't ever remember having to use the intrinsic model type (D, Q, MN, NJF, etc) when using the AKO syntax. It shouldn't be necessary. If you found that it was for BJT, it suggests that the base model you used wasn't in standard.bjt, and LTspice then fell back to the default BJT when the the AKO was used.

--
Regards,
Tony


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

I'm using ako: with a trailing (field) separator, as written in "General Form" in MicroSim's PSpice reference manual (as far as I remember, MicroSim introduced ako:).
But in the corresponding example, MicroSim omitted the space.
I hope LTspice will continue to accept ako: with and without trailing separators.

Excerpt from MicroSim PSpice A/D 7 Reference Manual:
Commands:
...
.MODEL (Model)
...
General Form:
.MODEL <model name> [AKO: <reference model name>]
+ ...
...
Example:
...
.MODEL QDR2 AKO:QDRIV NPN (BF=50 IKF=50m)

(from Berkeley SPICE3: Field separators are blanks, comma, equal (’=’) sign, left or right parenthesis; extra separators are ignored)

Bernhard


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

On Mon, Mar 24, 2025 at 12:31 PM, Andy I wrote:
?
Parentheses around "Cje=0" should be optional.? Also, I might be mistaken but you might need to remove?the space between "AKO:" and the original model name "2N3904":
.model 2N3904_mod ako:2N3904 (Cje=0)
In any event, add that line as a SPICE Directive anywhere on your schematic.? Or add it into a separate text file that has your model definitions, if you prefer doing it that way.??Then change the transistor's value to "2N3904_mod" and it should use that Cje value.
?
The keyword "NPN" is not needed when using a .MODEL definition with AKO.? It is not shown in the LTwiki, and my assumption is that the "NPN" is neither needed nor desired.? Since you are picking up the original 2N3904 model definition, and that model already has the "NPN' in it, it is not needed to add "NPN" a second time, and it might not work correctly if you happened to type anything other than "NPN".? But I have not experimented with that.? My advice would be to stick to the format shown in LTwiki and leave "NPN" out of that .MODEL command (SPICE Directive) with AKO.
?
Andy
?
?
?
Yes, You are right, changing Cje from 8pf to 0p will shorten the depth of this glitch from -39.6mV to = 36.7mV. Contribute about 2.9mV improved.
?
I take AKO example for reference from the following:
?
Just some info to note.
?
Thank you for the discussion.
?
Best regards.


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

On Sun, Mar 23, 2025 at 10:03 PM, <ericsson.sunshine@...> wrote:
Since the foreign thread was talking about 'AKO' (a kind of), talking about inherited model params, may I ask , if applied eg: .model 2N3904_mod AKO 2N3904,?
Then I just want to modify the Cje from 8 pf to 0. How to specify the new 2N3904_mod's Cje in the same simulation file ?
According to , the format is like this:
.model 2N2222mod ako: 2N2222 bf=5?; same except lower beta
So you could write:
.model 2N3904_mod ako: 2N3904 Cje=0
Parentheses around "Cje=0" should be optional.? Also, I might be mistaken but you might need to remove?the space between "AKO:" and the original model name "2N3904":
.model 2N3904_mod ako:2N3904 (Cje=0)
In any event, add that line as a SPICE Directive anywhere on your schematic.? Or add it into a separate text file that has your model definitions, if you prefer doing it that way.??Then change the transistor's value to "2N3904_mod" and it should use that Cje value.
?
The keyword "NPN" is not needed when using a .MODEL definition with AKO.? It is not shown in the LTwiki, and my assumption is that the "NPN" is neither needed nor desired.? Since you are picking up the original 2N3904 model definition, and that model already has the "NPN' in it, it is not needed to add "NPN" a second time, and it might not work correctly if you happened to type anything other than "NPN".? But I have not experimented with that.? My advice would be to stick to the format shown in LTwiki and leave "NPN" out of that .MODEL command (SPICE Directive) with AKO.
?
Andy
?
?


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

On Sun, Mar 23, 2025 at 11:38 PM, <ericsson.sunshine@...> wrote:
I added this '.model TM1 ako: 2N3904 ?npn Cje=0', and changed the value of Q2 to 'TM1'. It didn't run out any error message.
I guess the syntax is correct, though not take effect to eliminate the glitch, the wire changed mentioned previously of 'C2 from cathode of D1 to Vcc' is much better.
The glitch was a combination of both things.? If I remember correctly, the path from C2 to D1 had the larger effect, but removing only that did not eliminate the glitch unless the capacitance in Q2 was also changed.
?
Andy
?


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

?
Since the foreign thread was talking about 'AKO' (a kind of), talking about inherited model params, may I ask , if applied eg: .model 2N3904_mod AKO 2N3904,?
Then I just want to modify the Cje from 8 pf to 0. How to specify the new 2N3904_mod's Cje in the same simulation file ?
?
?
Thank you very much.
Best regards.
?
I added this '.model TM1 ako: 2N3904 ?npn Cje=0', and changed the value of Q2 to 'TM1'. It didn't run out any error message.
I guess the syntax is correct, though not take effect to eliminate the glitch, the wire changed mentioned previously of 'C2 from cathode of D1 to Vcc' is much better.
?
FYR
Thank you very much.
Wish you happy & good healthy.
?
?


Re: Sawtooth waveform by simple BJTs, but dips at the top.

 

On Sun, Mar 23, 2025 at 10:30 PM, Andy I wrote:
?
Either remedy effectively connects C2 to the bypassed Vcc rail - i.e., to AC-ground - which might not be what you wanted.? Why does C2 connect to the cathode of D1?
?
Hi, Andy:
?
Thank you for the reply, yes, this matters, it eliminates the glitch, I should place the right capacitance to the right place, was misled by the wrong guide from internet heap.

?
Choosing a transistor with smaller Cje helps.? It is a nonlinear capacitor, by the way, so Vje and Mje also affect its capacitance.
?
2N3904 Cje = 8 pF
2N5210 Cje = 4.973 pF
?
Substituting a generic NPN eliminates this contribution to the glitch because its Cje = 0.
?
Andy
?
Since the foreign thread was talking about 'AKO' (a kind of), talking about inherited model params, may I ask , if applied eg: .model 2N3904_mod AKO 2N3904,?
Then I just want to modify the Cje from 8 pf to 0. How to specify the new 2N3904_mod's Cje in the same simulation file ?
?
?
Thank you very much.
Best regards.


Re: LTspice AKO

 

For the diodes of a circuit I have, I use? .model mydiode Ako: K100UF D and I name all my diodes mydiode.
?


Re: LTspice AKO

 

If I remember correctly, LTspice 24 v24.1.* screwed around with (messed up) AKO.? Since you are using v24.1.5, those errors might be a side-effect of that.
?
You could run an experiment (probably a DC sweep) to see if it picked up the NJ20 model, or if it fell back to the standard NJF model with defaults.
?
Andy
?


Re: LTspice AKO

 

On Sun, Mar 23, 2025 at 03:46 PM, Tony Casey wrote:
On 23/03/2025 18:31, eetech00 via groups.io wrote:
LTspice 24.1.5
?
I thought AKO could be used with NJF.
?
Content of BJT_mod.txt:
...........
.model NJ AKO:NJ20 NJF()
.model NJ20 NJF ( VTO=-2.5 BETA=1m LAMBDA=0.01 RD=100 RS=50
+ CGD=2p CGS=5p IS=1e-14 PB=0.7 FC=0.5 )
..........
?
Error produced in log:

BJT_mod.txt(43): Syntax error: Unexpected input.
.model NJ AKO:NJ20 NJF()
? ? ? ? ? ? ? ? ? ? ?????????????????? ^^
I guess not?
?
I tried removing NJF() from AKO statement but it didn't help.
It does work for JFETs.
The simulation runs but I'm not confident its using the proper JFET parameters because it doesn't show them when it produces the error. It may be using JFET defaults.
It works in 24.1.4 and 24.0.12. In 24.1.4, you get an error message in the logfile, but it still works. I don't have 24.1.5 installed yet. The NJF() is superfluous. You already have defined NJ20 as an NFT.
Yes, I know. But I had to that for BJT AKO to work so I tried useing it here.
Do you have braces in the instantiation? Try removing them. There are plenty of nuances here.
Already did. Doesn't help.
?


Re: LTspice AKO

 

开云体育

On 23/03/2025 18:31, eetech00 via groups.io wrote:
LTspice 24.1.5
?
I thought AKO could be used with NJF.
?
Content of BJT_mod.txt:
...........
.model NJ AKO:NJ20 NJF()
.model NJ20 NJF ( VTO=-2.5 BETA=1m LAMBDA=0.01 RD=100 RS=50
+ CGD=2p CGS=5p IS=1e-14 PB=0.7 FC=0.5 )
..........
?
Error produced in log:

BJT_mod.txt(43): Syntax error: Unexpected input.
.model NJ AKO:NJ20 NJF()
? ? ? ? ? ? ? ? ? ? ?????????????????? ^^
I guess not?
?
I tried removing NJF() from AKO statement but it didn't help.
It does work for JFETs.

It works in 24.1.4 and 24.0.12. In 24.1.4, you get an error message in the logfile, but it still works. I don't have 24.1.5 installed yet. The NJF() is superfluous. You already have defined NJ20 as an NFT.

Do you have braces in the instantiation? Try removing them. There are plenty of nuances here.

--
Regards,
Tony


Re: LTspice AKO

 

开云体育

You may be using a later version of LTspice than I am (24.0.11).

On 2025-03-23 20:02, eetech00 via groups.io wrote:
On Sun, Mar 23, 2025 at 12:06 PM, John Woodgate wrote:

I see. I agree that if it works for BJTs, it should work for FETs. But AKO is still, apparently, undocumented (pity!), so it may not be implemented for all parts.

Its shown a couple of places in "help". Its shown in the description for ".Model" and "MOSFET".
But not anywhere else. I used search glass in the html help.
--
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.


Re: LTspice AKO

 

On Sun, Mar 23, 2025 at 12:06 PM, John Woodgate wrote:

I see. I agree that if it works for BJTs, it should work for FETs. But AKO is still, apparently, undocumented (pity!), so it may not be implemented for all parts.

Its shown a couple of places in "help". Its shown in the description for ".Model" and "MOSFET".
But not anywhere else. I used search glass in the html help.


Re: LTspice AKO

 

开云体育

I see. I agree that if it works for BJTs, it should work for FETs. But AKO is still, apparently, undocumented (pity!), so it may not be implemented for all parts.

On 2025-03-23 18:49, eetech00 via groups.io wrote:
On Sun, Mar 23, 2025 at 10:42 AM, John Woodgate wrote:

You haven't specified what 'AKO' changes with respect to the parameters of the NJ20. I can't advise you on the correct syntax, never having used AKO, but it would be something like: (RS=20)

?
I shouldn't need to specify params.
?
I'm using this as a convenient way to access multiple versions of the same transistor contained in a model definition file.
?
In my schematic I use the value "NJ" for the transistor. This never changes
?
In my model definition file. I have multiple versions of same transistor, with different names and different parameters.
I use AKO in the model file to point to the model I want active.
This works fine with BJT models, but produces errors with FETs.
?
--
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.


Re: LTspice AKO

 

I have a schematic (that I can't get to right now) where I use many diodes of the same model where I use AKO.?


On Sun, Mar 23, 2025 at 2:49 PM, eetech00 via groups.io
<eetech00@...> wrote:
On Sun, Mar 23, 2025 at 10:42 AM, John Woodgate wrote:

You haven't specified what 'AKO' changes with respect to the parameters of the NJ20. I can't advise you on the correct syntax, never having used AKO, but it would be something like: (RS=20)

?
I shouldn't need to specify params.
?
I'm using this as a convenient way to access multiple versions of the same transistor contained in a model definition file.
?
In my schematic I use the value "NJ" for the transistor. This never changes
?
In my model definition file. I have multiple versions of same transistor, with different names and different parameters.
I use AKO in the model file to point to the model I want active.
This works fine with BJT models, but produces errors with FETs.
?


Re: LTspice AKO

 

On Sun, Mar 23, 2025 at 10:42 AM, John Woodgate wrote:

You haven't specified what 'AKO' changes with respect to the parameters of the NJ20. I can't advise you on the correct syntax, never having used AKO, but it would be something like: (RS=20)

?
I shouldn't need to specify params.
?
I'm using this as a convenient way to access multiple versions of the same transistor contained in a model definition file.
?
In my schematic I use the value "NJ" for the transistor. This never changes
?
In my model definition file. I have multiple versions of same transistor, with different names and different parameters.
I use AKO in the model file to point to the model I want active.
This works fine with BJT models, but produces errors with FETs.
?


Re: LTspice AKO

 

开云体育

You haven't specified what 'AKO' changes with respect to the parameters of the NJ20. I can't advise you on the correct syntax, never having used AKO, but it would be something like: (RS=20)

On 2025-03-23 17:31, eetech00 via groups.io wrote:
LTspice 24.1.5
?
I thought AKO could be used with NJF.
?
Content of BJT_mod.txt:
...........
.model NJ AKO:NJ20 NJF()
.model NJ20 NJF ( VTO=-2.5 BETA=1m LAMBDA=0.01 RD=100 RS=50
+ CGD=2p CGS=5p IS=1e-14 PB=0.7 FC=0.5 )
..........
?
Error produced in log:

BJT_mod.txt(43): Syntax error: Unexpected input.
.model NJ AKO:NJ20 NJF()
? ? ? ? ? ? ? ? ? ? ?????????????????? ^^
I guess not?
?
I tried removing NJF() from AKO statement but it didn't help.
?
--
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.