555 LT Spice issues (trying to produce ~7kHz ~sine wave) - Page 1
Forum section: electronics / beginners

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 04:42:27 pm
content: I was simulating a circuit(spice model:7khz-carrier-wave.asc) and I was surprised that my calculated RC values were significantly off. I expected to use a R2 resistance of 10307 ohms, but had to use 9857.6 ohms.After a bunch of googling I ran across alternate (1.38)  calculations for a 555 when calculating the period which is what LT spice seems to be using. The datasheet is using 1.44 .I tried to edit the builtin model and got a restriction error -.I tried to import a TI spice model  and got this error -.Thoughts?1:http://www.embeddedcomponents.com/blogs/2008/03/simulating-the-555-ic-with-ltspice/2:http://www.ti.com/lit/ds/symlink/ne555.pdf3:http://www.ti.com/product/TLC555/toolssoftware

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 04:50:41 pm
content: The final circuit will be tuned at assembly. At the same time, still frustrated by my building blocks 5% out from the datasheet.

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 04:57:28 pm
content: How do I fix this in LT Spice?

author: iMo
author_rank: Super Contributor
timestamp: November 28, 2019, 05:39:09 pm
content: The DS is using 0.69 for a different circuit, imho.

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 05:58:11 pm
content: I ran the simulation with the DS circuit first. I had the same 1.44 vs 1.38 issue there. The LT Spice ideal 555 is using the 1.38 in its model - which is not adjustable.I downloaded the TI spice model, but the param error is way out of my spice knowledge. I have not used spice sine the late 90s.

author: Zero999
author_rank: Super Contributor
timestamp: November 28, 2019, 06:39:28 pm
content: You shouldn't worry about the difference between 1.38 and 1.44, as the capacitor values will have a similar tolerance.The 555 isn't a wise choice if you want that level of precision. Use a crystal oscillator to clock a digital sine wave generator.https://www.analog.com/media/en/technical-documentation/data-sheets/AD5932.pdfhttps://www.analog.com/media/en/technical-documentation/data-sheets/AD9833.pdf

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 07:22:32 pm
content: In all the circuit will be active for about 1500ms, not really seeing this as precision, maybe I am going about this wrong.I am looking for a cheap (in BOM $$$) way to create a carrier wave for a NFC like communications device. It is inductive coupled - think air core transformer. The shape of the "sine" wave is not super critical, just trying (assuming it is important) to remove some of the harmonics from a square wave source.Again, at production the circuit will be tuned. I am simulating in spice to catch current and other issues going forward.I would ideally like to get the TI lib working. So far I have been finding random 555 libs, but none of them match the TI datasheet.

author: iMo
author_rank: Super Contributor
timestamp: November 28, 2019, 07:38:54 pm
content: Working TI's TLC555 Pspice model..

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 08:20:48 pm
content: Thanks!But, I seem to be missing ZZZ\\Robertugo\\tlc555

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 08:56:58 pm
content: That gets us closer, now timers.lib is missing...

author: iMo
author_rank: Super Contributor
timestamp: November 28, 2019, 09:33:10 pm
content: Updated the zip file above. Put all the stuff into the working folder.

author: jpyeron
author_rank: Regular Contributor
timestamp: November 28, 2019, 10:42:07 pm
content: thanks, i know see the changes you made to the lib.removed LAMBDA=2E-3 from:.MODEL TLC55X_NMOSD_HV NMOS LEVEL=3 L=10U W=100U KP={KPN} VTO={VTOHN} LAMBDA=2E-3 THETA=1.8E-01+ CJ={CJN} CJSW={CJSWN} CGSO={CGSON} CGDO={CGDON} RSH= 10 PB=0.65 LD= 70N TOX={TOX}removed LAMBDA=2E-3 from:.MODEL TLC55X_PMOSD_HV PMOS LEVEL=3 L=10U W=100U KP={KPP} VTO={-VTOHP} LAMBDA=2E-3 THETA=2.2E-01+ CJ={CJP} CJSW={CJSWP} CGSO={CGSOP} CGDO={CGDOP} RSH=10 PB=0.65 LD=70N TOX={TOX}added:.PARAM VT=BOLTZ*(TEMP+273.15)/ECHARGEon.MODEL DZ_18V D( IS={ISz} N={Nz} BV=18.0 IBV=5.0M EG={8*Nz*VT})

author: iMo
author_rank: Super Contributor
timestamp: November 28, 2019, 10:51:11 pm
content: I have not made the changes. See the author of the changes in one of the .asc files.

author: Zero999
author_rank: Super Contributor
timestamp: November 29, 2019, 11:22:47 pm
content: It's possible to import the model into the .asc file to avoid multiple files.The sine wave doesn't look great and it will require a buffer to reduce the output impedance.

author: MagicSmoker
author_rank: Super Contributor
timestamp: November 30, 2019, 12:06:17 pm
content: Filtering a square wave oscillator to get a sine wave is a bit kludgy, and if you are going to have to buffer the output then you might as well make an op-amp or transistor based oscillator. For example, the Colpitts configuration is a good choice that is easy to design, outputs a nice sine wave, and is fairly stable over time and temperature if NP0 ceramic capacitors are used. A good explanation can be found here:https://www.electronics-tutorials.ws/oscillator/colpitts.htmlUsually the gain element is a single NPN transistor, but an op-amp can be easier to get working; just make sure gain is at least 3 (but don't go too high or you'll get clipping). If you need a precise peak-to-peak voltage level then it is safest to feed the output of the oscillator into a voltage divider then buffer that with an op-amp follower, if necessary.If you want to avoid using an inductor (which seems to be a common fear among beginners), then there are many other op-amp based oscillators that rely only on RC networks, though most are (somewhat ironically) more difficult to get working and/or have a less pure output (exception: Wein bridge). In any event, there are so many ways to make a decent 10kHz sine wave oscillator there's really no reason to chose filtering a square wave output from a 555 timer. See, for example, this image collection from a duckduckgo search of "op-amp RC oscillator circuits":https://duckduckgo.com/?q=op-amp+rc+oscillator+circuits&t=ffhp&iar=images&iax=images&ia=images