Author Topic: LTSpice  (Read 1671 times)

0 Members and 1 Guest are viewing this topic.

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
LTSpice
« on: December 18, 2019, 06:52:27 pm »
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?
« Last Edit: December 18, 2019, 07:00:35 pm by TheDood »
 

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #1 on: December 18, 2019, 07:07:46 pm »
 :palm:
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?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LTSpice
« Reply #2 on: December 18, 2019, 07:20:45 pm »
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.
 
The following users thanked this post: TheDood

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #3 on: December 18, 2019, 07:34:59 pm »
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.
 

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #4 on: December 18, 2019, 07:54:50 pm »
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.
Thanks, 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.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3382
  • Country: gb
Re: LTSpice
« Reply #5 on: December 18, 2019, 08:07:56 pm »
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.

Definitely a "trap for young players" as Dave would say!  Get into the habit of using net labels on nodes of interest to avoid this.
 
The following users thanked this post: TheDood

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #6 on: December 19, 2019, 04:39:27 pm »
Lol @mikerj, spot on, heard his voice in my head when I read that  :-DD

Attached 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
« Last Edit: December 19, 2019, 04:50:19 pm by TheDood »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LTSpice
« Reply #7 on: December 19, 2019, 11:15:45 pm »
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.
« Last Edit: December 20, 2019, 04:33:54 pm by Zero999 »
 
The following users thanked this post: Siwastaja, Ian.M

Offline alanambrose

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: gb
Re: LTSpice
« Reply #8 on: December 20, 2019, 03:40:17 pm »
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
“A foolish consistency is the hobgoblin of little minds"
 
The following users thanked this post: TheDood

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #9 on: December 20, 2019, 05:21:13 pm »
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
Thanks 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?
« Last Edit: December 20, 2019, 05:22:53 pm by TheDood »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LTSpice
« Reply #10 on: December 21, 2019, 09:44:31 am »
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?
Open 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.
 
The following users thanked this post: TheDood

Offline TheDoodTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Re: LTSpice
« Reply #11 on: December 21, 2019, 11:37:13 am »
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?
Open 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.
Lol jeez thanks, idk how I missed that
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf