Author Topic: LTSpice measurement differs from reality  (Read 2955 times)

0 Members and 1 Guest are viewing this topic.

Offline AeternamTopic starter

  • Supporter
  • ****
  • Posts: 97
  • Country: lu
    • Schartz Engineering
LTSpice measurement differs from reality
« on: December 22, 2015, 04:54:06 pm »
The title says it all. I have a schematic that reads a different output in LTSpice than what I measure on the prototype board.

Every readout on the nodes is pretty much identical to what I measure on my breadboard, except for the output. LTSpice says it should read 130 mA (bottom right), whereas "in real life" I get 50 mA output. I'm pretty sure it's a user error, but I'm kinda lost. It would help if I knew how to measure the voltage drop across R6 but it wouldn't let me set a measurement reference on the right side of it (probably because it's hooked up to ground.) I can put it on the left side of it, but then it won't pop up the probe when I hover over the right leg. Bummer :(

I attached the schematic. (The R1 and R7 voltage divider is representing a potentiometer, seemed like the easiest way to set it up.) I should also mention that U2s output is a measured 4.87V on the breadboard whereas Spice calculates it to be 4.397V.

Can anyone point me in the right direction?

Pretty please? :)
 

Offline awallin

  • Frequent Contributor
  • **
  • Posts: 694
Re: LTSpice measurement differs from reality
« Reply #1 on: December 22, 2015, 05:04:45 pm »
first guess: 128 mV is too close to your op-amp negative supply (which looks like 0 V or GND).
either bias the whole circuit so your operating point is at say 1V, or provide bipolar supplies to the op-amps so they can swing close to GND without issues.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14199
  • Country: de
Re: LTSpice measurement differs from reality
« Reply #2 on: December 22, 2015, 05:53:03 pm »
The LM324 may have an offset of up to about 10 mV. So thight explain some difference but not all. WIth a 1 Ohm resistor, the lines connectors might also add a little there. There is also a small chance that the circuit is oscillating thus dilivring 100 mA part of the time. However the circuit in principle looks ok.

The slight difference in OP output voltage jst reflects variabel threashold of the MOSFET - not all of them are the same. SO nothing to warry about that.
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: LTSpice measurement differs from reality
« Reply #3 on: December 22, 2015, 06:40:18 pm »
It would help if I knew how to measure the voltage drop across R6 but it wouldn't let me set a measurement reference on the right side of it (probably because it's hooked up to ground.) I can put it on the left side of it, but then it won't pop up the probe when I hover over the right leg.

If you just click on the left leg, you get a plot of voltage with respect to ground. Since the right leg is grounded, the plot you get is the voltage across R6.

You only need the click-drag-release way to plot a voltage if neither of the nodes is ground.

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: LTSpice measurement differs from reality
« Reply #4 on: December 22, 2015, 06:57:02 pm »
What happens if you add a 100nF capacitor across the R6?
 

Offline owiecc

  • Frequent Contributor
  • **
  • Posts: 315
  • Country: dk
    • Google scholar profile
Re: LTSpice measurement differs from reality
« Reply #5 on: December 22, 2015, 07:05:08 pm »
If every readout you see is similar to the simulation then R6 is not 1ohm. Another option is that your circuit is unstable and is oscillating.
 

Offline eetech00

  • Regular Contributor
  • *
  • Posts: 64
Re: LTSpice measurement differs from reality
« Reply #6 on: December 22, 2015, 07:41:24 pm »
If you change R6 to about 0.25 ohms it will measure about 50mV. R6 probably isn't 1 ohm.
How are you making the measurement?
 

Offline AeternamTopic starter

  • Supporter
  • ****
  • Posts: 97
  • Country: lu
    • Schartz Engineering
Re: LTSpice measurement differs from reality
« Reply #7 on: December 22, 2015, 08:08:22 pm »
Did I read oscillation? Looks like I finally have the excuse I needed to get that scope  :-DD

Lots of ideas on what to check, thanks all for your input. I'll head over to the bench and check them out!
 

Offline AeternamTopic starter

  • Supporter
  • ****
  • Posts: 97
  • Country: lu
    • Schartz Engineering
Re: LTSpice measurement differs from reality
« Reply #8 on: December 22, 2015, 08:18:55 pm »
 |O

The cables that I used to hook up R6 have a 1 Ohm resistance each. Sure enough if I change R6 to reflect that I get a 43mA output in Spice.

Problem solved, you guys are the best  :-+
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: LTSpice measurement differs from reality
« Reply #9 on: December 22, 2015, 08:26:21 pm »
|O

The cables that I used to hook up R6 have a 1 Ohm resistance each. Sure enough if I change R6 to reflect that I get a 43mA output in Spice.

Problem solved, you guys are the best  :-+

Classic!  >:D :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf