LTspice wont simulate a circuit with some component values - Page 1
Forum section: electronics / general

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 11, 2021, 12:30:13 pm
content: I've been using LTspice for a few months now, it's simple and easy to use, so that's really nice, but i don't understand why some component values cause the simulation to not work. for example in thie circuit, i've been changing some values of resistors just to find one where it happens, since while designing this circuit i've had to use odd resistor values for it to show something in the simulation and it's getting annoying. In this case, R4, one value that doesn't work if 5400 ohm, but 5399 does work. (this is also the reason why i have R7 and R5 as milliohm and micro-ohm, because with a wire the simulation won't work, i'll just get a line on the left. Any idea what may be happening? this is getting incredibly annoying.Thank you!

author: RoGeorge
author_rank: Super Contributor
timestamp: April 11, 2021, 01:01:59 pm
content: Is there any error message?Attach the .asc file of the two working/not working schematics, so others can run the simulation and try to debug it.When the simulation end in an error, usually those are convergence problems. SPICE simulations means matrix algebra, and sometimes trying to solve those matrix equations doesn't converge. In SPICE there are some coefficients that fine tune the math behind matrix solving.For a start, resets those settings to their default values (from Tools -> Control panel -> SPICE -> Reset to Default Values), and see if it starts working. Most of the times the default values are working, sometimes they need manual adjustment.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: April 11, 2021, 01:53:44 pm
content: Hi,Two observations:1) the coupling capacitors are HUGE for the frequency (5MHz) you are simulating with. Try reducing the values of C1-C4 to 1nF.2) The transistor model for the 2N3866 is not included in the LTspice distribution. Where did you get the model for the 2N3866? Please attach the model if you share your .asc files.Here is a quick model of the center amplifier:It works fine.I have embedded the transistor model in the .asc file.The .asc file is attached.Regards,Jay_Diddy_B2N3866 amp bjt.asc(2.96 kB - downloaded 203 times.)

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: April 11, 2021, 02:27:57 pm
content: Hi group,I managed to reproduce the issue that was reported by Anthocyanina.The issue is that are very few data points in the output, making it impossible to draw a graph. This is why you get 'empty' waveforms.The problems is caused by the large time constant in the coupling capacitors in the model and the short analysis time.The issue can be fixed by either:1) Increase the simulation, 10us should workor2) set the maximum time step to 0.1usor3) reduce the value of the coupling capacitors.I have attached my model.Jay_Diddy_B2N3866 amp bjt 2.asc(3.6 kB - downloaded 167 times.)

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 11, 2021, 09:53:53 pm
content: Quote from: RoGeorge on April 11, 2021, 01:01:59 pmHi! I don't get any error message, just with some values the simulation will only output one green line on the left. i have all the settings as default and resetting them didn't help. Thank you! here i attach the .asc and the 2n3866 model i used for this simulation is the one provided by digikey.

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 11, 2021, 10:06:14 pm
content: Quote from: Jay_Diddy_B on April 11, 2021, 01:53:44 pmHi Jay! yes the capacitors are large for that frequency but i need this amplifier to work across a wide range of frequencies, from <1Khz to ~25MHz, if the capacitors are too small, the lower frequencies will be too attenuated. the 5MHz you see there was one of the frequencies i tested to see everything was working as expected (no clipping or too much distortion) that i can't see with the AC analysis option which just shows me magnitude and phaseQuote from: Jay_Diddy_B on April 11, 2021, 02:27:57 pmBut if the problem is the time of the simulation, or the time constant, why does changing the value of a component by an insignificant amount make the simulation run correctly? I've also found out it's changing any value of any component after the simulation does run properly, like if i increase or decrease the 12 volt supply by a millivolt, it will work properly. Thank you!

author: RoGeorge
author_rank: Super Contributor
timestamp: April 11, 2021, 11:33:16 pm
content: Quote from: Anthocyanina on April 11, 2021, 09:53:53 pmYou need to attach the model file too, or at least put a link to the exact file if you didn't attach it because of licensing reasons or else there is no guarantee others will download the same file as you have (for example from EU there are no models, I had to search on a NZ digikey sitehttps://www.digikey.co.nz/product-detail/en/central-semiconductor-corp/2N3866-PBFREE/1514-2N3866PBFREE-ND/4806874to find this onehttps://www.centralsemi.com/docs/csm/2N3866.LIBattached - delete the .txt part from the attached filename, that was added by me only because EEVblog forum does not allow .lib files to be attached).Also, my request was for both .asc files, one for the working version and one for the not working version.Anyway, it seems like you found some sort of bug.To me it worked, but only at the first run, then it didn't work any more.However, if I put minimum simulation step 0.01u, asJay_Diddy_Bsuggested, it works just fine.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: April 11, 2021, 11:37:36 pm
content: Hi,The issue with SPICE is that it solves all the equations for one operating point, to within a certain tolerance. It then jumps to a time in the future and tries to solve again, if it is successful it jumps again. If was unsuccessful it try a time point closer to the original. With some circuit it can jump solve the equations and miss some events.By setting the maximum time step, you stop this from happening.Amplifier ModelTake a look at this model:I have made the following changes:1) dc coupled three stages. This reduces the number of components and improves the frequency response.2) replaced the first two transistors with low-cost 2N3904. Significant cost saving.3) set the bandwidth from 400Hz to 30 MHzThe model is attached.Regards,Jay_Diddy_B2N3866 amp bjt 3.asc(2.96 kB - downloaded 156 times.)

author: RoGeorge
author_rank: Super Contributor
timestamp: April 11, 2021, 11:52:56 pm
content: The curious thing is first time it run OK with ".tran 1u".Then I changed R4 to 5399 and also run OK.Then I changed again R4 to the innitial 5400, and from that moment it didn't work any more.I've tried closing LTspice and deleting intermediary created file and still didn't work with 5400 and .tran 1uThe only way to make it work again with R4 5400 was to add a max timestep, ".tran 1u 0 0.01u".I'm very sure I've seen it working once with 5400 and ".tran 1u", that is why I reminded OP I was requested for both working and not working versions of asc (after first run I thought OP uploaded the working .asc and typed that part of the reply).

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 11, 2021, 11:54:03 pm
content: Quote from: RoGeorge on April 11, 2021, 11:33:16 pmHi! i've attached the model i've used. i just copied the data into the standard.bjt file to be able to just select the transistor from the list. I've als attached the working .asc with 5399 ohms R4. I'm going to start adding minimum simulation steps and see if this goes away and i can start simulating with any value! Thank you!

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 12, 2021, 12:01:51 am
content: Quote from: Jay_Diddy_B on April 11, 2021, 11:37:36 pmThank you Jay! it wasn't clear to me how SPICE ran the simulations. About your model, isn't the dc operating point too high? in the second stage at 8.4V the voltage swing without distortion will be about 3 volts peak instead of 4, no? I was aiming for 8Volts peak to peak at the output, Thanks again!

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: April 12, 2021, 12:23:26 am
content: Hi,Quote from: Anthocyanina on April 12, 2021, 12:01:51 amNo Extra ChargeModel is attached.Jay_Diddy_B2N3866 amp bjt 4.asc(3.02 kB - downloaded 163 times.)

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: April 12, 2021, 01:05:30 am
content: Quote from: Jay_Diddy_B on April 12, 2021, 12:23:26 amThank you very much! this looks like it will work perfectly for what i need it