LTSpice - Page 1
Forum section: electronics / beginners

author: TheDood
author_rank: Regular Contributor
timestamp: December 18, 2019, 06:52:27 pm
content: I've been having issues with LTspice. How bad does it glitch for others? Can anyone post a link to a download from a trusted source?Ive been trying to learn by doing simulations but I can't seem to find consistency. I've definitely made errors but today I've tried to make the exact same cct and getting different results. I started out breaking the sims down into smaller parts as suggested. I created a PWM generator cct out of OP Amps (OP07) and can simulate varying frequencies and duty cycles as expected when using a DC voltage source component, but as soon as I replicate the DC voltage source with a DC cct creating ~same voltages, I'm unable to replicate PWM like when using the LTspice Voltage source component??^^For an example of this compare files "PWM(1)" & "Regulator1." The top portion of schematic "Regulator1" OP Amp power-rail, PWM inverting input, PWM non inverting input ~matches the "PWM(1)" schematics OP Amp power-rail, PWM inverting input, PWM non-inverting input voltages. 1 gives me a PWM (DC voltage component) but the other only goes completely high or completely low (DC cct).I think these next 2 comparisons might be the exact same cct but giving different results. Refer to files "Regulator1" & "PWM2." "Regulator1" bottom portion is disconnected from the live cct and I've made the exact same cct in the top portion of "Regulator1" as the entire "PWM2" file. I've used different bridge diodes but aside from that all components are exactly the same and same layout. Refer to attached waveforms to notice the drastic change in voltages from 1 schematic to the other. I've been staring at it for awhile, so I'm not ruling out simple errors, but I've tried to find them and coming up short.EDIT:Both C2's in "Regulator1" & "PWM2" are charging to 170V.. Somewhere between C2 and OP Amp PWM generator string I'm getting different readings?

author: TheDood
author_rank: Regular Contributor
timestamp: December 18, 2019, 07:07:46 pm
content: I found I was missing the 4-way node on the 2nd OP Amp output on the "Regulator1" schematic. Once added it gives the same result as the "PWM2" file.Now I'm just trying to determine why I've been unable to generate a PWM when using a DC cct to create the V's compared to using the DC V source component?

author: Zero999
author_rank: Super Contributor
timestamp: December 18, 2019, 07:20:45 pm
content: There's nothing wrong with LTSpice. It's the circuits.I can tell that circuit won't work because it's powered by a potential divider consisting of 10k and 60k, which will have an output impedance of 10k||60k = 8k57. Scrap the potential divider and run off plain DC. If you want to simulate the bridge rectifier and ripple, it can be done later and just use an AC voltage source with the peak voltage of the transformer's secondary, you plan to use. Potential dividers aren't normally used to power circuit run off the mains, as they provide no isolation. The only time one might be used is for measuring mains voltage, in an application which doesn't require isolation.The OP07 can't drive such low resistance values as 50R and 15R. Choose resistors which will not result in loading the output excessively.The LED circuit can't possibly work, because the rectifier doesn't have an AC input voltage.Oh, please don't post such large, scaled-up images. Size the appropriate window to something reasonable, then go to tool>copy bitmap to clipboard, paste into an image editor and save as a .png.

author: TheDood
author_rank: Regular Contributor
timestamp: December 18, 2019, 07:34:59 pm
content: Well, I've gotten the DC cct to simulate correctly now too. Its simulating like the DC voltage source. Idk, I probably have just been making silly errors.

author: TheDood
author_rank: Regular Contributor
timestamp: December 18, 2019, 07:54:50 pm
content: Quote from: Zero999 on December 18, 2019, 07:20:45 pmThanks, I was just messing with different values for different components trying to get the correct figures. I've since changed it and its doing what I was expecting. I used an 18V zener and put a cap in parallel with the last 2 R's in the voltage divider and changed R values.I think I've been making changes and then running the sim but the nodes have changed as well and I've not been reprobing the same points to view where I should be viewing. Thanks for the input, I'll play around with different R values in the OP Amp string.

author: mikerj
author_rank: Super Contributor
timestamp: December 18, 2019, 08:07:56 pm
content: Quote from: TheDood on December 18, 2019, 07:54:50 pmDefinitely a "trap for young players" as Dave would say! Get into the habit of using net labels on nodes of interest to avoid this.

author: TheDood
author_rank: Regular Contributor
timestamp: December 19, 2019, 04:39:27 pm
content: Lol @mikerj, spot on, heard his voice in my head when I read thatAttached is the latest schem and file, it takes forever to sim so Ill probably try to determine the POT size, limits, ect in a more simple cct to sim. From the times I ran it up to ~2s or so before halting it seems that the current is decently managed but still has some fluctuating that I'm not sure how I feel about.Anyone have any pointers on how to create Voltage references without burning much wattage? I switched back to a capacitive dropper to power the Voltage reference cct but it takes quite some time on startup to charge up and direct OPAmps. Maybe I can put some sort of switch cct that switches the V reference cct to a capacitive dropper after initial charge? Then the V reference cct would be ready to go fast, and then switched to the more limiting type of power input after initial charge?Also, I'll take pointers on how to create a more steady current too?And then I'm also thinking maybe Ill add some sort of OP-Amp config in such a way that I can utilize a bigger POT, because so far the sims call for only about a difference of 0.7V or so between 100% duty cycle and 0% duty cycle. Is that possible? Using an OP Amp and a few R's to create a ~0.7V swing from beginning rotation to end rotation of a POT when it's hooked up? Is there a way to increase the V range used to determine the duty cycle? I've tried several things mostly consisting of changing R values (independently and grouped ect), and changing V's being compared (higher lower ect) but still find that the entire duty cycle range is controlled by a delta of ~<1V.Since I've switched the V ref cct to a more series type of layout along with the cap dropper style of power input, the cct takes more than 4s to charge up (didn't wait longer). Idk if my Time Delay OP-Amp is configured correctly either. I was trying to compare the 2 voltages and then when one of the Vs was greater than the other, multiply their difference by 10× and output the gained Voltage. The delta V should only be 0.7V (8.2V zener & 7.5V zener) so I figured 10× would be 7V and the reasoning behind the V mgmt is I'm assuming it will consume less power to output 7V instead of going power rail high like in an open loop config? Maybe it's consuming the same power either way, just burning V on R's compared to an open loop config where all power is put to output rather than burning V at R's?Thanks

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2019, 11:15:45 pm
content: Sorry, I'm just about to go to bed, so can't give a very detailed reply at the moment. All I'll say is: drop the idea of using a non-isolated mains supply such as a capacitive dropper. Buy a small switched mode power supply. A non-isolated circuit like that is very dangerous unless adequate precautions are taken and should not be attempted by a beginner. It's fair enough if all you want to do is play around in SPICE, but it shouldn't be built.

author: alanambrose
author_rank: Frequent Contributor
timestamp: December 20, 2019, 03:40:17 pm
content: I find in general that LTSpice tends to be a bit picky. It won't warn you if you've missed an obvious connection (I had a case yesterday, where I didn't notice a tiny part of a trace was missing, and was scratching my head for a while). In the latest version I've also seen it need a restart before it would solve correctly again. Also, if your circuit is a bit hard, it might just take forever to solve - then you need to either tweak the solver parameters or amend the circuit to make it easier to solve.First look for easy user error though - that's 90% of the cases. Forgotten to put power onto the chip you're simulating? Missing one of the inputs to an op amp? Spice won't tell you and may just solve (or not) anyway with some odd results until you figure out what is wrong. Divide and conquer works for debugging difficult cases i.e. simulate each segment separately until you have each working fine. Then you can string them together. All in all, it works (mostly) but it's a bit fragile.Alan

author: TheDood
author_rank: Regular Contributor
timestamp: December 20, 2019, 05:21:13 pm
content: Quote from: alanambrose on December 20, 2019, 03:40:17 pmThanks Alan,I was curious if there's any way to select a grouping of components in a schematic and copy paste to a new file for easier "dividing and conquering?" Like a way to drag and drop into a new schem file or select multiple components + nets at one time to copy paste into a new file?

author: Zero999
author_rank: Super Contributor
timestamp: December 21, 2019, 09:44:31 am
content: Quote from: TheDood on December 20, 2019, 05:21:13 pmOpen the two schematics, simultaneously in the same instance of LTSpice. Go to Window>Tile Vertically or Horizontally, to get the two schematics on the screen, at the same time. Click the schematic you want to copy from. Click the copy button on the toolbar, drag a box round the part of the schematic you want to copy, click on the destination schematic, drag the parts to a convenient space and click.

author: TheDood
author_rank: Regular Contributor
timestamp: December 21, 2019, 11:37:13 am
content: Quote from: Zero999 on December 21, 2019, 09:44:31 amLol jeez thanks, idk how I missed that