Author Topic: Beginner LTspice Question  (Read 635 times)

0 Members and 1 Guest are viewing this topic.

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Beginner LTspice Question
« on: February 20, 2024, 12:37:26 am »
Electronics newbie here. A little experience with soldering together guitar pedal kits and a basic understanding of individual components.
I am having an LTspice problem. I downloaded the latest version (24.0.9). I have been working with tutorials to try to learn how to use the program to simulate guitar pedal circuits. The latest version has an updated interface and different file locations. With my limited experience with it I am not locating any good tutorials that can walk me through how to do things.

I am trying to simulate a real circuit that I have soldered up and put in a box. It is called a "Tiny Tester". It generates a steady sine wave to recreate the sound of a guitar string being played. This signal is then fed out into a guitar pedal for troubleshooting the pedal. It gives a steady signal (about 440Hz) to test pedals without needing a guitar.

I have simulated other circuits in LTspice and they have worked as expected. On those I was able to probe and find the DC voltages. I could also probe and view the sine waves on the waveform viewer.

On the LTspice simulation of the Tiny Tester I have probed all the DC voltages in the schematic and they match the voltages on the real circuit. I don't see any sine wave output on the waveform viewer. I only get a reading of +17uV DC at the output.

Does my schematic look correct? One change is that I modeled the variable pot as two resistors because I did not see an easy way to insert a variable pot.
Am I missing some Simulation Command setting that needs to be added/changed? Have I skipped some step on this simulation? I admit that I am just guessing on the Configure settings but they worked on the last similar schematic I set up.

Any suggestions are appreciated. I monitor and reply as my work schedule allows.

I have attached some info and snips.

 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: sc
Re: Beginner LTspice Question
« Reply #1 on: February 20, 2024, 01:19:36 am »
RC oscillator usually need quite a while to start oscillating, either waiting the caps to charge up, or for some leakage/random noise to upset the balance.

Try giving the sim a bit more time, or start the sim from zero state instead of steady state.
 

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Beginner LTspice Question
« Reply #2 on: February 20, 2024, 01:27:23 am »
I will try that.
Thanks.
 

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Beginner LTspice Question
« Reply #3 on: February 20, 2024, 01:42:53 am »
I tried adjusting times under Configure Analysis. Is this the proper place to make the change? This is the only spot I know.
Changed the output reading but still not showing a sine wave.
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: sc
Re: Beginner LTspice Question
« Reply #4 on: February 20, 2024, 01:44:12 am »
Yes, try like 1 second instead of 0.04
 

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Beginner LTspice Question
« Reply #5 on: February 20, 2024, 02:12:54 am »
Score!

That got me in the ballpark. I will need to do some research on what the configure analysis settings do.

I will figure out how to zoom in and I will be in business.

Thanks for your help. Much appreciated.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Beginner LTspice Question
« Reply #6 on: February 20, 2024, 02:25:32 am »
It takes approx. 0.2 seconds for the oscillation to build up to a significant amplitude.  The loop gain is initially greater than unity so the oscillation grows exponentially until Q2 starts saturating in the troughs, when the resulting clipping reduces the large signal gain to unity.

If you add the startup option to the .tran command, (check 'Start external DC supply voltages at 0V'), it adds a power-on transient which kick-starts the oscillation so it stabilises in under 20ms, however the downside is that the .op operating point is now useless.

A technique that may be useful with very high Q oscillators to avoid unreasonably long sim runtimes before the oscillator noticeably starts, is to force them at or very close to their operating frequency with a sinusoidal current source for a number of cycles to build up the amplitude more quickly.  Once Ncycles is reached, the current source output becomes zero, effectively removing it from the circuit.  The forcing current should typically be an order of magnitude less than the AC component of that due to steady oscillation at the point of injection.

To zoom in on a waveform, drag a box over what you want to see zoomed, then right-click and 'Autorange Y-axis' to best fit the amplitude of the zoomed in trace(s) (or not if you want to Zoom amplitude as well).  To get back to the original unzoomed trace, right-click and 'Zoom to Fit'.
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1432
  • Country: ca
Re: Beginner LTspice Question
« Reply #7 on: February 20, 2024, 03:39:25 am »
I just got a single BJT phase shift osc. running in LTSpice. If I was going to amplify or buffer it I'd couple it to another stage with a capacitor. So what are the advantages of using DC coupling in a case like this ? IDK if there's a down side either, I'm just not used to it I guess.
 

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Beginner LTspice Question
« Reply #8 on: February 20, 2024, 04:14:24 am »
I added the "start at 0 volts". Wave readings now start immediately. Good idea.
Injecting a sinusoidal source sounds like a good trick to keep in mind if needed in the future.
Thanks for info on zooming in. Very easy.

Do you think there is something I could do to smooth out the waveform?
I know the capacitor values (C1,2,3) change the frequency of the output signal but I wonder what would clean it up?
I am at the stage that I can grasp what individual components do but I am still learning to visualize out what happens when they interact.
Probably not needed (the real circuit is acceptable so far) but starting with a more ideal wave might make it easier to troubleshoot a pedal later.

Thanks for your input.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Beginner LTspice Question
« Reply #9 on: February 20, 2024, 05:24:17 am »
If its fixed frequency, low pass filter the s--t out of it to drastically reduce the harmonics.  This will reduce the amplitude a lot, so you need to also add a high linearity gain stage.  If you need a variable frequency sine source, tracking filtering would be PITA, so you'd do better to start with a better sine oscillator circuit, and stabilise its amplitude in a way that minimises the distortion.
« Last Edit: February 20, 2024, 05:27:19 am by Ian.M »
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6785
  • Country: pl
Re: Beginner LTspice Question
« Reply #10 on: February 20, 2024, 06:10:00 am »
Do you think there is something I could do to smooth out the waveform?
Reduce minimum time step of transient simulation.
 
The following users thanked this post: Ian.M

Offline PedalChaseTopic starter

  • Newbie
  • Posts: 6
  • Country: us
Re: Beginner LTspice Question
« Reply #11 on: February 20, 2024, 06:46:38 am »
No, a variable frequency is not needed for my use.

Thanks for the addition of what I believe is called an RC filter.

I will play with that in simulation before I build a second unit to see if I want to go that route.

I have not entered any time step in the Configure Analysis. I will have to research to see what that even is and what it does.

Thanks to everyone for the help. I am learning a lot here.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Beginner LTspice Question
« Reply #12 on: February 20, 2024, 06:58:28 am »
Do you think there is something I could do to smooth out the waveform?
Reduce minimum time step of transient simulation.
Yes LTspice can draw some pretty jagged waveforms when you zoom in, simply because it doesn't have enough data points. Right click and do View =>Mark Data Points, to see what its up to.  I used 50us timestep above, chosen to be about two orders of magnitude smaller than the oscillator period, and also used
Code: [Select]
.opt plotwinsize=0 to turn off waveform data compression, to support zooming in a lot. The down-side is massive .raw files.

Another way to reduce the real distortion is to reduce the loop gain of the oscillator by increasing the emitter resistor R4.  However, if you go too far the oscillator wont!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf