¿ªÔÆÌåÓý

Date

Re: LTSpice Model for Photo Triac - VOM160

 

Eric wrote:

? ? "I uploaded both circuits so you can maybe is it okay you can take a look."

What you uploaded didn't include the symbol and library files.? We like to have all uploads be complete, so that they don't depend on other files elsewhere.

So I copied over the two files (LED_TRIAC_ZCS.asy and?MOC308x.lib) that I said you needed.

When I run "Heater-circuit-MOC3083_modified.asc", it won't run because that schematic tries to load "st_standard_snubberless_triacs_LTspice.lib" which isn't there either.? I don't think it's needed in that schematic, is it?? So then I copied that file over too, anyway.? Now when I run it, it runs without any errors.? Is this the one you said had an "Unknown subcircuit" error?

When I run "Heater-circuit-MOC3083-fresh drawn.asc" (after having added the symbol and library files), I get the error about "Unknown subcircuit".? The reason is because you forgot to do steps (2) and (3) that I described earlier.? The text immediately under the symbol needs to be changed to "MOC3083", and there must be the line to include the library file that has its subcircuit definition:

? ? .lib MOC308x.lib

Fix those two, then it should work.

Regards,
Andy



Cannot download IR2117_test.zip because of certificate error

 

I am trying to download the IR2117_test.zip file found under "Files"
Clicking on the link takes me to website?, but I get error message?NET::ERR_CERT_AUTHORITY_INVALID

Am I the only one that cannot access the download files under TAB Files?




Re: LTSpice Model for Photo Triac - VOM160

 

Hi Eric,

If you run LTspice with the schematic that's inside the ZIP file, then that is the problem.? When you open something in a ZIP archive, Windows creates a temporary copy of JUST that one file, nothing else.? So none of the library and symbol files are there with it.? They are still in the ZIP file, but not in the temporary folder where Windows put the schematic file before sending it to LTspice.

You have to extract the contents of the ZIP file.? Then you can run it.? Running from a ZIP file works only if there are no other files involved.

(I don't think it matters, but I use a separate program for opening ZIP files on my PC.? I'm aware that MS-Windows itself can open ZIP files, but I don't let it do that.)

There is no need to move any files to other locations, not with this ZIP file.

? ? "By the way, the LTSpice XXVII program is on my C drive while I save all my trial schematics on my D drive. Is this an issue?"

Nope.

More later.

Regards,
Andy



Re: Single supply VCO

 

I completely agree with Helmut, that the MODULATE block works correctly.? It has whenever I have used it.

None of us knows the actual code.? Well, Panama Mike does.? But he is not likely to reveal it.

You can create your own FM modulator circuit (using a B source) with idt() to integrate the FM input voltage, and apply it to the phase of a sine wave, thus producing a correct frequency modulated signal.? The MODULATE block's output is the same.? Therefore I conclude that it PROBABLY also integrates the input voltage and adds it to the phase.

Why are you asking?

Andy



Re: LTSpice Model for Photo Triac - VOM160

 

Hi Andy,

I have LTSpice XVII which was just updated then. When I opened the zip file, I just clicked into the heater circuit schematic file? and it opened automatically in the LTSpice space.??
So I clicked Run but I remember it displayed something like MOC308x.lib can't be found. I didn't know what was going on and I thought you will also see the same thing when you open it.? Thus I posted it .
After reading your instructions, I loaded the .lib files to "sub" directory, and all symbols to the "sym" directory, and loaded the schematics to my drive D simulations file. Then on LTSpice space, I opened the saved
schematics and Run it. Wallah it ran:). By the way, the LTSpice XXVII program is on my C drive while I save all my trial schematics on my D drive. Is this an issue?

So now I tried to draw a simple fresh schematic using the newly loaded??LED_TRIAC_ZCS?part. It wouldn't run. It flagged this issue " Unknown subcircuit called in: xu2 n002 0 n003 0 led_triac_ZCS.

So I tried to copy the original heater schematic, paste it into a new schematic page in LTSpice space, then modify it to be exactly like my fresh circuit, it works. So I'm not sure where the problem is.?

I uploaded both circuits so you can maybe is it okay you can take a look. The description? is MOC3083 Trial Circuit Comparison.

Thanks and best regards,
Eric


On Wed, Nov 21, 2018 at 11:08 AM Eric Henares <eohenares@...> wrote:
Hi Andy,
Thank you very much for your very quick reply and taking your time to explain details. I will continue with this query after my personal errand.?
Best regards,
Eric

On Wed, Nov 21, 2018 at 12:41 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric wrote:

? ? "I found the MOC308x phototriac circuit simulation (solved) from the htm files.? I tried to RUN it but it won't."

I downloaded it (it's the same file that was uploaded here around a month ago), extracted it, and it ran.? There were a bunch of "heightened def con" messages in the .log file, but those are not necessarily bad, and they don't indicate failure.

So, it always helps to tell us what didn't work.? Did your computer shut off, or burst into flames?? Was there an error message?? If there was, what was it?? Try to be specific.? Also tell us which version of LTspice you used: LTspice IV or LTspice XVII.

All I did was create a brand new folder, extract the contents of the ZIP file into that folder, open the .asc file in LTspice, and press RUN.? There was nothing else to do.? You didn't move any of the files anywhere else, did you?

Have you altered your LTspice settings?? You might have changed the settings in the Control Panel at some point.? If you think you might have done that, open the Control Panel (hammer icon), press "Reset to Default Values", and OK.? Then try running the simulation again.

? ? "How do I load this part into my library?"

I think you need only these two files:
? ? LED_TRIAC_ZCS..asy
? ? MOC308x.lib
You can either put them in the folder with the schematic(s) that will use them, or add them to LTspice's libraries.? I prefer the former, but you could do either.

To add them to LTspice's libraries, move or copy LED_TRIAC_ZCS.asy here:
? ? Documents\LTspiceXVII\lib\sym\
or to a subdirectory of it.? Move or copy MOC308x.lib here:
? ? Documents\LTspiceXVII\lib\sub\
(must be that folder, not a subdirectory of it).

If you leave both files in the folder with your schematic, you'll need to do one extra step when putting the symbol on a schematic.? Open the schematic file in LTspice (if it's new, make sure to save it so that its file is in the current folder).? Go to the Add Components menu.? At the top, there is a line for "Top Directory" with two choices.? One is LTspice's library; the other is the current directory.? Change it to the current directory.? Now the LED_TRIAC_ZCS symbol should be in the menu and can be selected.

Whichever method you used, follow these steps:

(1)? Add a LED_TRIAC_ZCS symbol to the schematic.
(2)? Right-click on the text LED_TRIAC_ZCS under the symbol, and change it to MOC3083.
(3)? Add this line as a SPICE Directive:

? ? .lib MOC308x.lib

I am not 100% certain that the above steps work, but I think they should be right.

Regards,
Andy



Re: Trying to simulate a 27Mhz receiver. Couple of questions

 

Another thing comes to mind:

It could be useful to do an .AC analysis rather than (or in addition to) .TRAN analysis.? .AC analysis involves sweeping the frequency, so it is helpful for looking at tuned circuits.? To do an .AC analysis, you should remove the Modulate component and substitute an ordinary voltage source (keeping the series resistor), with its "AC" value set to 1V.? In SPICE .AC analysis is a linear analysis, so you get the same results whether signals are microvolts or megavolts; therefore it is often convenient to set the signal source's amplitude to 1V.

I might start with .AC analysis until I get the tuned circuits where I want them, then change to .TRAN analysis with the modulated signal source.

An .AC analysis doesn't tell you anything about circuits that are nonlinear.? Therefore, it would be meaningless for the detector portion of your receiver.? Likewise, RF mixers in a heterodyne receiver would not simulate correctly in .AC analysis.? But it's useful for checking the linear RF circuits.

Regards,
Andy



Re: Trying to simulate a 27Mhz receiver. Couple of questions

 

Interposted -

*Plain Text* email -- it's an accessibility issue
() no proprietary attachments; no html mail
/&#92; <>

On 2018-11-21 7:28 p.m., chuck@... [LTspice] wrote:
Actually a BUNCH of questions. LOL
1.How do I add a antenna. Or can I use a 27Mhz voltage source. Need to modulate it with 1K sig. How do I modulate the 27Mhz. Was able to model a sine wave source at 27Mhz but sticking the 1K signal on that is what is got me stumped.
Use a 27MHz voltage source with a Modulate device. (F2 or [Edit]->[Component]) -> SpecialFunctions -> modulate) Apply your modulation signal to the AM or FM input as required.

Trying to simulate a "toy" receiver
How can I tune a tank circuit? Variable cap? Model somewhere?
Insert a capacitor. Set its value to "{varCapVal}" (right-click on the cap symbol and type {varCapVal} into the Capacitance box)

Set the capacitor value in a .param statement (e.g. ".param varCapVal=1u" (without the "" marks)) You can use a list for the varCapVal (Help is very useful for syntax help) to get a variety of capacitances, or enter a formula so that the capacitance varies with time (then use the oscilloscope to look for whatever characteristic is important, and use the time at the max/min of that characteristic to figure out what capacitance is desirable.)

Can't use the PC out of the toy. Want to be able to turn VCC on and off to save battery life.
I don't understand this question. The simulation has all the energy in the universe available; the PeeCee uses a little to simulate your circuit and calculate the answer. It takes very little time and/or battery.

If you need the simulated Vcc to turn on/off, right-click on the V symbol you put on the schematic and set the off voltage, on voltage, delay time, on time, ...

Brand new to spice and not the sharpest pencil in the drawer, so I really need some help.
Thanks
Chuck


Re: Starting the process

 

Chuck wrote, "Sent a message with a question seperatly then saw this email"

What email was that?

Please add some context so we know what you're talking about.

Regards,
Andy



Re: Trying to simulate a 27Mhz receiver. Couple of questions

 

Chuck asked about radio receiver simulations:

? ? "1.How do I add a antenna. Or can I use a 27Mhz voltage source."

SPICE doesn't do antennas.? Yes, you can use a signal source, connected to the appropriate point in your circuit.? I'd recommend a voltage source in series with a resistance, because I'm sure the antenna doesn't behave like an ideal voltage source, and it would likely mess up your receiver circuit if driven directly by a voltage source.

? ? "Need to modulate it with 1K sig. How do I modulate the 27Mhz."

There are a lot of ways to do that, depending on how you want it to be modulated.? AM?? FM?? PM?

LTspice has a most helpful circuit element, called "Modulate".? It is an AM and FM modulator.? I strongly urge you to use that, rather than any other method for making an AM or FM signal for simulations.? Find it in the Components menu, in the [SpecialFunctions] folder.? You'll have to scroll to the end to find it.? The "Modulate2" component is the same except that it has quadrature (Sine and Cosine) outputs.

To use them, connect the 1kHz voltage source to either the AM or FM input (not both).? The other input can either be connected to a suitable voltage, or left floating.? Then right-click on the Modulate symbol, and add these two parameters to the Value field:

? ? Mark=27MEGHz? Space=27MEGHz

The Space parameter value will be the output frequency when the FM input voltage is 0V.
The Mark parameter value will be the output frequency when the FM input voltage is 1V.
Note that SPICE requires "MEG".? If you use "MHz" you'll get milliHertz.? Can be just "MEG" because SPICE ignores what comes after it.

If you want the signal to be AM, you can set both Mark and Space to 27MEGHz and leave the FM input disconnected or grounded.

If you want AM, the voltage that you apply to the AM input pin needs to be suitably offset, so that its value never goes negative.? When the voltage at the AM input just reaches 0V on the negative peaks, you are at 100% modulation, so anything more than that would be overmodulation.? Yes you could do that, but then you don't have a proper AM signal anymore.

The output of the Modulate device has a 1 ohm output impedance.? So you probably should add a series resistor between it and your receiver circuit.? How much resistance, well that depends on what sort of antenna you have.? You might also want to attenuate the signal too -- either that, or drive the AM input with a very small voltage.

? ? "How can I tune a tank circuit? Variable cap? Model somewhere?"

Do you want to change the tuning during a simulation?? It's probably better to run a simulation, then change the tuning and run another.? Use the .STEP command to automate this process.

If you do want to vary a capacitor during a simulation, be careful because it's not just a matter of changing its capacitance.? That would violate conservation of charge.? LTspice lets you overcome that problem by specifying the charge instead of the capacitance.? See the Help page for capacitors.

If you run into problems with your simulations, consider uploading the circuit you've done to the "Temp" folder, and send a message with your questions.

Regards,
Andy



Starting the process

 

Hopefully this is what you need? Sent a message with a question seperatly then saw this email


Trying to simulate a 27Mhz receiver. Couple of questions

 

Actually a BUNCH of questions. LOL ?

1.How do I add a antenna. Or can I use a 27Mhz voltage source. Need to modulate it with 1K sig. How do I modulate the 27Mhz. Was able to model a sine wave source at 27Mhz but sticking the 1K signal on that is what is got me stumped.?

Trying to simulate a "toy" receiver?

How can I tune a tank circuit? Variable cap? Model somewhere?

Can't use the PC out of the toy. Want to be able to turn VCC on and off to save battery life.?

Brand new to spice and not the sharpest pencil in the drawer, so I really need some help.?

Thanks

Chuck


Re: Is there any good 8 Ohm 0.5W loudspeaker model?

 

¿ªÔÆÌåÓý

I am sorry if I sound ignorant or misled by my own lack of understanding the problem at hand but a little while ago In this forum I derived some equations for simulating an electrostatic loudspeaker using what is similar to the old type analogue computer approach to simulate in LTspice the variation of capacitance with the voltage having assumed that the charge on the membrane remains constant. (also made reference to Weakepidia on the internet to try to get some understanding of how the ELECTROSTATIC loudspeaker works basically) I am not an Audio engineer and I have not as yet fully explained the interesting curves I got. Unfortunatey, neither did the person who paused the question to the forum replied nor make any
comments on my brief work despite my publication in this forum of my hand written derivations. I still have my hand written notes and equations. The reason I have mentioned this work is that It occurs to me that by making inferences to the first law of thermodynamics one can work out the power developed within the speaker having? taken the energy stored in the capacitors or electric field developed and more accurately consider the losses incurred in the process. If you are interested in my Ideas, please reply to this e-mail and we will exchange views.? I think it would be interesting.

Best regards,

Michael P Kiwanuka

From: LTspice@... on behalf of rjc@... [LTspice]
Sent: 21 November 2018 18:25
To: LTspice@...
Subject: [LTspice] Re: Is there any good 8 Ohm 0.5W loudspeaker model?
?
?

think of it this way - the loud speaker is like a or a with relatively poor ratio that is near input

google[] , []

SUM :: for adequate model you should include the physical membrane displacement tracking . . . which would make the model over exhaustive for processing power point of view -- that unless you succeed to define some simplified mathematical model that relates the electrical I/O to mechanical response (the analogy is the (about ) , etc. ...)


Re: Single supply VCO

 

Hello,

I am sure the MODULATE block works as a FM-modulator as expected. You can check this, if you do? simulation followed by a FFT. You will get the frequency spectrum as calculated by math.

Best regards,
Helmut
?


Re: Odd behaviour of Bsource

 

PhB,

Thanks for this helpful suggestion. I am amazed that I was able to find your correct answer while searching for completely unrelated information!


Re: Single supply VCO

 

Helmut,

Would you, please, reveal the math performed by the MODULATE block on the "FM" input? Does it add the integral of the "FM" input voltage to 2*pi*fspace*time in the same way that one would expect for a theoretical frequency modulator?

Thanks,


Re: radiated noise from a twisted set wire

 

¿ªÔÆÌåÓý

Another important point is the "twisted pair" requirement. The question seems to have an implied EMI (Electro-Magnetic Interference flavor.? On that assumption, I mention that not only is the radiated power dependent on the frequency components of the current in the wires, there is a spacial factor as well.?? High rate twists will tend to cancel the low frequency radiation patterns if the current "out" is balanced by the current "back".? I.e., the area of the loop formed by the current loop of the wire spacing and that loop can include the earth return if the current is essentially outbound from the source and coming back in some other path than the 3 wires.? Unless the 3 wires are a differential pair with a single wire shield, you are pretty much assured of unbalance and higher radiated energy.? Modeling the spatial factors in LTspice is not something I would even begin to try.? RF modelling software that includes 3-dimensional object modelling along with electrical factors is called for in this instance.
Regards,
Charles Patton

On 11/21/2018 9:50 AM, Andy ai.egrps@... [LTspice] wrote:
?
flpierson wrote:

? ? "What I need to do is take the FFT of the average current of the three wires. How do I go about doing that?"

First, define what you mean by "the average current of the three wires."

I don't even know what "average current" means in the context of an FFT.? Usually an FFT operates on a waveform.? When you average that waveform, you no longer have the waveform; you have just a number.? You can't take an FFT of a number.? Does "average" mean "filtered" or "smoothed"?? Why bother doing that?? Can't you just take the FFT of the current as it is?

What do you mean by "the three wires"?? Do you want the FFT of the current through each wire -- hence, three FFT spectra?? Or do you want the FFT of something like the net current of all three wires combined?

In LTspice it's easy to get the FFT of any number of signals..? Plot the ones you want on a waveform plot, then right-click > View > FFT.? Here, you can choose how many data samples, the time range over which to evaluate the FFT, whether to do a wee bit of smoothing by averaging adjacent time points, and whether to apply a windowing filter.? The latter is unnecessary if you've chosen the time span to include an exact integer number of cycles.? The waveforms that were plotted are highlighted in the top, but you can change which one or ones you want.

Click OK.? Now, if you had two or more waveforms selected, you'll get another window that lets you choose again exactly which ones to plot.? If you want all three, just highlight them all.? Or you can enter an expression here (such as I(R1)+I(R2)+I(R3)).

Click OK.? Voila, there's your FFT spectrum or spectra.

Now, if the thing you want is the FFT of the combined current, figure out what that means to you.? Do you want the common-mode current?? Differential mode?? Make an expression for what you want.? Then implement it.? You could do that with a Bv source added to your schematic (so that it exists as a separate signal that can be probed), or you can enter the expression later in the FFT process.

If you are new to FFTs, make sure that you do all the things necessary to get a good FFT.? Choose an appropriately small Maximum Timestep.? Disable waveform compression by adding ".options plotwinsize=0" to your schematic (it's essential!).? Make sure to use an integral number of cycles in the time interval passed to the FFT.? If there are start-up transients, wait for those to die out before starting the FFT.? Choose the total time interval wisely, as it affects the FFT's appearance -- one cycle is probably too little, 1000 cycles is probably too much.? Finally, LTspice's FFT shows you tons of high-order harmonics that may have no meaning, so ignore them, unless you are sure that the waveforms have meaningful data up there at those frequencies.? I guess the philosophy is it's better to start with too much data and discard what you don't want, than to start with too little and not know that there was more.

Regards,
Andy




Virus-free.


Re: radiated noise from a twisted set wire

 

Using the BI worked. thanx!


Re: Is there any good 8 Ohm 0.5W loudspeaker model?

 

think of it this way - the loud speaker is like a or a with relatively poor ratio that is near input

google[] , []

SUM :: for adequate model you should include the physical membrane displacement tracking . . . which would make the model over exhaustive for processing power point of view -- that unless you succeed to define some simplified mathematical model that relates the electrical I/O to mechanical response (the analogy is the (about ) , etc. ...)


Re: radiated noise from a twisted set wire

 

flpierson wrote:

? ? "What I need to do is take the FFT of the average current of the three wires. How do I go about doing that?"

First, define what you mean by "the average current of the three wires."

I don't even know what "average current" means in the context of an FFT.? Usually an FFT operates on a waveform.? When you average that waveform, you no longer have the waveform; you have just a number.? You can't take an FFT of a number.? Does "average" mean "filtered" or "smoothed"?? Why bother doing that?? Can't you just take the FFT of the current as it is?

What do you mean by "the three wires"?? Do you want the FFT of the current through each wire -- hence, three FFT spectra?? Or do you want the FFT of something like the net current of all three wires combined?

In LTspice it's easy to get the FFT of any number of signals.? Plot the ones you want on a waveform plot, then right-click > View > FFT.? Here, you can choose how many data samples, the time range over which to evaluate the FFT, whether to do a wee bit of smoothing by averaging adjacent time points, and whether to apply a windowing filter.? The latter is unnecessary if you've chosen the time span to include an exact integer number of cycles.? The waveforms that were plotted are highlighted in the top, but you can change which one or ones you want.

Click OK.? Now, if you had two or more waveforms selected, you'll get another window that lets you choose again exactly which ones to plot.? If you want all three, just highlight them all.? Or you can enter an expression here (such as I(R1)+I(R2)+I(R3)).

Click OK.? Voila, there's your FFT spectrum or spectra.

Now, if the thing you want is the FFT of the combined current, figure out what that means to you.? Do you want the common-mode current?? Differential mode?? Make an expression for what you want.? Then implement it.? You could do that with a Bv source added to your schematic (so that it exists as a separate signal that can be probed), or you can enter the expression later in the FFT process.

If you are new to FFTs, make sure that you do all the things necessary to get a good FFT.? Choose an appropriately small Maximum Timestep.? Disable waveform compression by adding ".options plotwinsize=0" to your schematic (it's essential!).? Make sure to use an integral number of cycles in the time interval passed to the FFT.? If there are start-up transients, wait for those to die out before starting the FFT.? Choose the total time interval wisely, as it affects the FFT's appearance -- one cycle is probably too little, 1000 cycles is probably too much.? Finally, LTspice's FFT shows you tons of high-order harmonics that may have no meaning, so ignore them, unless you are sure that the waveforms have meaningful data up there at those frequencies.? I guess the philosophy is it's better to start with too much data and discard what you don't want, than to start with too little and not know that there was more.

Regards,
Andy



Re: radiated noise from a twisted set wire

 

¿ªÔÆÌåÓý

Add to your schematic a B type current source whose current is the sum of the three line currents. Connect a resistive load to it to prevent its voltage becoming infinite. Then take the FFT of the B source. You need not divide the sum by 3 because that will not affect the FFT.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-21 17:15, flpierson@... [LTspice] wrote:

?

I have a 3 phase twisted set wire radiating noise. I've constructed what I believe if a sufficient filter to knock the noise down to acceptable levels. What I need to do is take the FFT of the average current of the three wires. How do I go about doing that?