Author Topic: Phase Measurement in LT Spice  (Read 4723 times)

0 Members and 1 Guest are viewing this topic.

Offline eev_carlTopic starter

  • Regular Contributor
  • *
  • Posts: 224
  • Country: us
Phase Measurement in LT Spice
« on: December 07, 2018, 02:07:38 pm »
Hi,

Am I applying this .meas directive correctly?  I'm trying to get the phase angle between the two sine waves.  On the scope, I measured this at about 80 degrees but am getting 63 degrees from .meas.

Thanks,
Carl



 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12917
Re: Phase Measurement in LT Spice
« Reply #1 on: December 07, 2018, 02:51:23 pm »
Attach your sim as a .asc file so others can check it easily.
 
The following users thanked this post: eev_carl

Offline eev_carlTopic starter

  • Regular Contributor
  • *
  • Posts: 224
  • Country: us
Re: Phase Measurement in LT Spice
« Reply #2 on: December 07, 2018, 03:10:56 pm »
Here's my .asc
 

Offline eev_carlTopic starter

  • Regular Contributor
  • *
  • Posts: 224
  • Country: us
Re: Phase Measurement in LT Spice
« Reply #3 on: December 07, 2018, 03:16:17 pm »
Also, with regards to the scope picture...the yellow sine wave is a direct connection from the function generator. I'm using a BNC splitter.  The other half of the splitter goes to the circuit.  The blue sine wave is at the junction of the R and the E.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12917
Re: Phase Measurement in LT Spice
« Reply #4 on: December 07, 2018, 04:01:12 pm »
Why did you strip the .measure commands?
Code: [Select]
.meas TRAN TIME_1 TRIG V(Vin)=0 RISE=2 TARG V(Vin)=0 RISE=3
.meas TRAN TIME_2 TRIG V(Vin)=0 RISE=2 TARG V(Vout)=0 RISE=2
.meas phase param 360*(TIME_2/TIME_1)

With the .tran 0 1m .5m command from the sim you attached, I am also getting about 80 deg, confirmed by cursor measurements.   With your original .tran 50m I'm getting the same bogus 63 deg you got.

I suspect the cause is too many cycles and not enough data points due to your initially ill-chosen simulation duration.
 
The following users thanked this post: eev_carl

Offline eev_carlTopic starter

  • Regular Contributor
  • *
  • Posts: 224
  • Country: us
Re: Phase Measurement in LT Spice
« Reply #5 on: December 07, 2018, 04:48:49 pm »
Sorry about the .meas.  I posted the .asc before saving.  Thanks for the note on the duration.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3272
  • Country: gb
Re: Phase Measurement in LT Spice
« Reply #6 on: December 07, 2018, 05:08:44 pm »
With the .tran 0 1m .5m command from the sim you attached, I am also getting about 80 deg, confirmed by cursor measurements.   With your original .tran 50m I'm getting the same bogus 63 deg you got.

I suspect the cause is too many cycles and not enough data points due to your initially ill-chosen simulation duration.

The cause is the DC shift in the first few cycles. Ignoring this data by adding the 0.5ms recording start time fixes the problem rather than the simulation duration.
 
The following users thanked this post: Ian.M, eev_carl


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf