Author Topic: Struggles with simulation in LTSpice  (Read 1074 times)

0 Members and 1 Guest are viewing this topic.

Offline RaviTopic starter

  • Newbie
  • Posts: 4
  • Country: no
Struggles with simulation in LTSpice
« on: March 22, 2020, 08:38:52 pm »
Hello!

I'm relatively new to LTSpice, I have a project to simulate in LTSpice. I appreciate any help you guys can afford. the project is a distance measure using ultrasound transducers. I have a timing generator which generates a square wave to start TX to send an ultrasound signal and a sawtooth signal wich feeds Sample and Hold circuit. When RX recieves an echo signal, it sends it to an amplifier wich enables Hold state. The voltage that is held is sent to VCO (using 555 timer) wich generates a proper signal according to Hold voltage, see attached block diagram and LTSpice file.

My headache is the transmitter TX which it generates a 40 kHz signal when it simulated only with the timing generator but when it is simulated with the whole circuit, it generates a 20 kHz! And i don't have a clue of why!

thanks in advance!
« Last Edit: March 22, 2020, 09:36:42 pm by Ravi »
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: au
Re: Struggles with simulation in LTSpice
« Reply #1 on: March 22, 2020, 09:20:58 pm »
you have a couple of sub circuits that you should upload too.

.LIB C:\Users\Rawi\Documents...\Prosjekt\LTspice-extra-\lmc6482a.sub

.lib C:\Users\Rawi\Documents...\Prosjekt\LTspice-extra-\lm324.sub
 
The following users thanked this post: Ravi

Offline RaviTopic starter

  • Newbie
  • Posts: 4
  • Country: no
Re: Struggles with simulation in LTSpice
« Reply #2 on: March 22, 2020, 09:41:42 pm »
Hi HackedFridgeMagnet!

Thanks for the fast response!

I tried to upload them but it was not possible with .sub files so i changed to .txt. I hope it is okay?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Struggles with simulation in LTSpice
« Reply #3 on: March 22, 2020, 11:19:07 pm »
Hi HackedFridgeMagnet!

Thanks for the fast response!

I tried to upload them but it was not possible with .sub files so i changed to .txt. I hope it is okay?
No, don't do that. Paste them into the .asc file, as SPICE directives, that way it's all one file. I don't have time to try to get it to work at the moment, but here's your .asc file, with all of your models embedded. I tried skipping the initial operating solutiion and starting with power supplies at 0V, but it didn't work.
 
The following users thanked this post: Ravi

Offline RaviTopic starter

  • Newbie
  • Posts: 4
  • Country: no
Re: Struggles with simulation in LTSpice
« Reply #4 on: March 22, 2020, 11:24:43 pm »
Thanks Zero999!
Appreciate that :D!
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Struggles with simulation in LTSpice
« Reply #5 on: March 24, 2020, 10:10:43 am »
I've had a look at the simulation. The problem is it was generating convergence errors. I got it to simulate by changing the op-amps to generic models with the slew rate, bandwidth and input impedance set to match the data sheets.

I don't think the circuit does what you want it to though.

You should break it down into sections and simulate each individually, rather than plugging the whole thing into the SPICE.
 
The following users thanked this post: Ravi

Offline RaviTopic starter

  • Newbie
  • Posts: 4
  • Country: no
Re: Struggles with simulation in LTSpice
« Reply #6 on: March 24, 2020, 10:22:49 pm »
Hi Zero999!

I really appreciate what you have done!
As you mentioned, i should break it down to smaller circuits.

Have a nice day/evening!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf