In the data sheet one can find a minimum parts circuit, a high gain circuit, and a bass boost circuit:
Gain = 20 (26 dB), minimum parts
|Gain = 200 (46 dB)|
There isn't any official Spice model available from the manufacturer of the chip, at least not that I have been able to find. But there is a "no-frills LM386 model" attributed to Dave Dilatush (5/30/95) so I used that and a put it in a separate LM386.sub file.
The Spice code is quite simple and listed at the end of this posting. The result is shown here in two sets of curves. The first is for the 26 dB and 46 dB amplifiers.
The first result is in the left-hand curve which shows that the high-gain version has problems with the low frequency response, so I increased the 10 μF feedback capacitor to 100 μF in the right-hand plot (between pins 1 and 8). That makes the plot almost as flat as that of the data sheet down to 100 Hz.
|26 and 46 dB amplifiers according to data sheet||26 and 46 dB amplifiers with 100 uF in the feedback|
Second, the high frequency response is too high in the simulation compared to the data sheet shown below. The Spice model does not seem to have enough high-frequency roll-off.
Third, close inspection shows that the gain of the high-gain amplifier (the blue curve) levels off at 45.4 dB, not 46 dB. This should indicate that the open-loop gain of the Spice model is not high enough.
For comparison, the data sheet plots the responses as follows:
In conclusion, in order to do simulate the LM386, there is a need for a Spice model with more roll-off at high frequencies and with a higher open loop gain.
I also observe that there is a constant current source in the LM386 model of value i1=5 mA. It must for sure be too high since the data sheet says that the quiescent current for the entire chip is min. 4 mA, max 8 mA.
Before there is any point in simulating the "Unleashing the LM386"-circuit that I introduced in Sprat (autumn 2003) or the simplified version that SM7UCZ (Johnny Apell) introduced in Sprat this spring - both based on the circuit of JF1OZL (Kazuhiro Sunamura), the Spice model needs some improvement. These circuits are also in George Dobbs, G3RJV's articles in Practical Wireless, May and July 2014.
Actually I knew that improvements are needed since I have already tried with inconsistent results. But I have the hope that some of the readers may steer me towards an improved model.
- Dave Dilatush no-frills LM386 model.
- Comments on the quality of the LM386 Spice model.
- Datasheet for LM386
Spice code for use with TopSpice or LTSpice:
Spice circuit for the LM386 (store in LM386.sub):