LTSpice - Is there a way to plot nonlinearity

Discussion in 'General Electronics Chat' started by eblc1388, May 15, 2011.

  1. eblc1388

    Thread Starter Senior Member

    Nov 28, 2008
    1,542
    102
    The attached image shows the response of a diode through a temperature sweep. It appears to be linear.

    Is there a way to plot the deviation of the response against a straight line of approximate the same slope? i.e. just to show the deviation or non-linearity?

    I know I might be able to get that by using waveform arithmetic but I just can't seem to be able to use 'temp' as the x-axis variable in the calculation to get the deviation.

    Thanks

    [​IMG]
     
  2. ifixit

    Distinguished Member

    Nov 20, 2008
    639
    108
    Hi eblc1388,

    One method would be to use a behavioral model (bv) to plot a linear function close to the expected values and then compare with the actual diode characteristic. I used 20°C as a reference point where the two are assumed to be almost equal. Use 2mV per °C for the estimated perfect slope.

    Have Fun,
    Ifixit
     
  3. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    On the waveform, change v(out) to d(v(out)). Decrease your step size to 1°C or less. The model appears to have discontinuities or something, because you get little bumps in the curve.
     
  4. rapidcoder

    Member

    Jan 16, 2011
    37
    3
    No, the original SPICE diode model does not have discontinuities in it. These bumps are caused by inacurracies of the LTSpice simulation engine, probably by running the NR loop too few times. Try to lower the RELTOL setting.
     
  5. eblc1388

    Thread Starter Senior Member

    Nov 28, 2008
    1,542
    102
    Thanks all for the fast response.

    ifixit offers what I wanted as I would be reading the actual diode voltage and using a linear relationship to calculate the temperature. I need to know how linear is the diode voltage vs temperature and the non linearity error to decide if I need to apply any correction to the final calculated temperature.

    Looks like the linearity is very good for all practical purposes.
     
  6. rapidcoder

    Member

    Jan 16, 2011
    37
    3
    The forward diode current is given by the formula:

    I = IS(T) * (Exp(VD / (VT * N)) - 1)

    where IS is the saturation current of the diode, dependent on the temperature according to the formula:

    IS(T) = IS * Pow(T / TNOM, XTI / N) * Exp(q * EG * (T - TNOM) / (k * T * TNOM * N))

    Because all the temperatures are in K, in the close neighbourhood of TNOM (300K) the characteristic is quite linear.
     
Loading...