Electronics > Projects, Designs, and Technical Stuff
LTSpice LM394 Log Converter
(1/2) > >>
mc172:
I'm messing around with a log converter (aka log amplifier) in LTSpice and am a bit stuck. I figured that a good place to start would be an application note or something so found this on the LM394 NPN "supermatched pair" datasheet:



The LM394 datasheet can be found here: http://www.sycelectronica.com.ar/semiconductores/LM394.pdf

When I put this circuit into LTSpice I get the following performance:



The red trace is Vout and the green trace is Vin. I have attached a ZIP file containing the LTSpice simulation.

The plot has Vin (V(n009)) as the horizontal scale, which is the input to the log converter and is a 1 Hz triangle wave going from 1 uV to 10 V. I expect to see a straight line (which would be the log of a triangle on a log scale) but I only see that for 3 decades. Has anyone got any idea why I only get log conversion after 10 mV?

I have built other variants such as the circuit in the SSM2212 datasheet and have the same problem - I can only get about 3 decades out of it. I am tempted to just build one and see if it works but I'd like to get the simulation working really.
Ian.M:
The LM394 datasheet only claims four decades range for that circuit, and elsewhere it notes that most datasheet parameters are guaranteed from 1uA to 1mA Ic, which implies only a three decade range with guaranteed accuracy.

I don't have your transistor or OPAMP models, but doing a .dc sweep over a carefully chosen six decade range:

--- Code: ---.dc dec V4 30u 30 50
--- End code ---
using the generic UniversalOpamp2 model with its default parameters and any small signal NPN, gives very close to a straight line for six decades - far better than I suspect you'll achieve in real life.  Remember all LTspice components default to being 0% tolerance, and most to being ideal.
mc172:
Thanks for that. I just tried what you wrote in the code tags and indeed I get around 6 decades.

I was previously manually commanding a voltage source to generate a triangle, something like this:


--- Code: ---PULSE(0.000001 10 0.1 0.4 0.05)
--- End code ---


Do you know why doing a DC sweep gives different results to giving it a triangle? Not that it matters - I won't do that any more!
Ian.M:
At the very beginning of the triangle wave, the transient response of the circuit is critically important.  I think it is compromising the result for very low Vin due to the brief period from when the up-ramp starts till it crosses  1mV.
Ian.M:
Yep, confirmed.  Avoid the too rapid transition through the uV decades by using a behavioural voltage source to implement an exponential function for the input:

--- Code: ---V=pow(10,7*time-6)
--- End code ---
and you'll get six decades with acceptable linearity same as the .dc sweep gave.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod