Author Topic: LTSpice .meas Help  (Read 3447 times)

0 Members and 1 Guest are viewing this topic.

Offline Glenn0010Topic starter

  • Regular Contributor
  • *
  • Posts: 225
  • Country: mt
LTSpice .meas Help
« on: August 18, 2019, 03:15:50 pm »
Hi all,

I am not very used to spice directives and would like some wisdom.

I have the circuit below where I am to measure the different fall time of an IGBT under different load currents. I have done .meas scripts however this only does the measurement for the first fall time. I would like this to be repeated for all the rest of them. other than copy pasting it several times, is there a more elegant way of doing this?



Cheers
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: LTSpice .meas Help
« Reply #1 on: August 18, 2019, 03:33:51 pm »
Off the top of my head, I would try something like this:
- Make V1 only generate ONE pulse.
- Use a parameter for the load current.
- Use a .STEP directive to make above parameter sweep through the intended range.
- Keep your .MEAS directives as is.

But some questions: how do you modulate the load current here? Is something important hidden by the Cursors Window?

 

Offline Glenn0010Topic starter

  • Regular Contributor
  • *
  • Posts: 225
  • Country: mt
Re: LTSpice .meas Help
« Reply #2 on: August 18, 2019, 03:44:03 pm »
Off the top of my head, I would try something like this:
- Make V1 only generate ONE pulse.
- Use a parameter for the load current.
- Use a .STEP directive to make above parameter sweep through the intended range.
- Keep your .MEAS directives as is.

But some questions: how do you modulate the load current here? Is something important hidden by the Cursors Window?

The load current is dictated by then inductor size. The value of the inductor dictates the rise time, if this simulation were longer the inductor current would keep on rising.

Using the step command can I "set" the current through the inductor? Say setting an initial condition
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: LTSpice .meas Help
« Reply #3 on: August 18, 2019, 03:46:07 pm »
Ok, makes sense now. But sorry to be thick, where is the power supply? Is it not hidden on the right?
 

Offline Glenn0010Topic starter

  • Regular Contributor
  • *
  • Posts: 225
  • Country: mt
Re: LTSpice .meas Help
« Reply #4 on: August 18, 2019, 03:47:15 pm »
Oh yes it is, it is a 800v dc supply
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: LTSpice .meas Help
« Reply #5 on: August 18, 2019, 04:33:35 pm »
I see.
Well I don't think you can really do anything but add more .measure directives to do this. You can't just copy the ones you showed, because they will always only get the first falling edge. You'll need to add some TRIG parameter to them I think, to get measurements for each next falling edge.

One way to only write the 3 .MEAS directives once would be to use a .STEP directive, and step a parameter for the trigger point (parameters can be used in .MEAS directives). Downside is, it would launch a simulation for each stepped parameter, whereas the parameter would only influence the measurements and not the transient analysis itself, so wasted time. If the simulation is fast, that's an option though to automate the process. (Hope you got what I meant.)
 

Offline Dmeads

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
  • who needs deep learning when you have 555 timers
Re: LTSpice .meas Help
« Reply #6 on: August 18, 2019, 06:33:24 pm »
if you put create a parameter for your the inductance value by putting it in curly brackets and naming it (i.e. load or whatever you want),
then you can use a list and step through the values you want to see results from. the different colors on the waveform show the different results from the sweep. I believe the first value in your list would correspond to whatever the first color is in you waveform color preferences, and the second corresponds to the second color...

check the picture.

let me know if this helps :)
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: LTSpice .meas Help
« Reply #7 on: August 18, 2019, 07:20:51 pm »
*DON'T* *FORGET* to use
Code: [Select]
.opt plotwinsize=0
so your .measure statements run against the raw results that haven't been compressed.

Parameterize the time to start saving data from in the .tran command and .step it.   Its still inefficient as it re-runs the sim for each set of .measure commands.

Alternatively, if sim run time is a significant problem, knock up a repeated .measure script generator in whatever high level language with good string handling you prefer (or even in a spreadsheet!), and use it to increment an instance number for the .measured variable names, and to increase TD in the measure command to pick out the pulses in turn, outputting a script with the repeated .measure commands you need.  Run it against the sim results using File=>Execute .MEAS Script with the plot window in focus.

N.B. If using TRIG and TARG you need a TD for each of them.  RISE/FALL/CROSS=count aren't reliable because they tend to count nearly invisible ringing on edges and glitches due to sim artifacts.
 

Offline Glenn0010Topic starter

  • Regular Contributor
  • *
  • Posts: 225
  • Country: mt
Re: LTSpice .meas Help
« Reply #8 on: August 20, 2019, 07:21:31 am »
Hi All thanks for all your help!

I have been busy these past 2 days but have managed to do some work on it.

What I have done is initialized the inductor initial condition as a parameter, then I am stepping through that parameter.

I have also implemented some of the suggestions you guys made.

Let me know if there are any obvious flaws in my logic there. Cheers

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf