{"id":252,"date":"2012-08-15T06:18:33","date_gmt":"2012-08-15T06:18:33","guid":{"rendered":"http:\/\/lushprojects.com\/blog\/?p=252"},"modified":"2017-02-26T22:30:10","modified_gmt":"2017-02-26T22:30:10","slug":"lm13700-missing-forumla","status":"publish","type":"post","link":"http:\/\/lushprojects.com\/blog\/2012\/08\/lm13700-missing-forumla\/","title":{"rendered":"LM13700 OTA &#8211; The missing forumla"},"content":{"rendered":"<p>If you do anything with analogue syths you quickly run in to the Operational Transconductance Amplifier (OTA) as a key component. These are amps whose current output depends on the voltage difference at the inputs and a control current that scales the gain. They are used for voltage controlled filters, voltage controlled amplifiers and oscillators. The subject of OTAs has a complicated and initially frightening set of assumptions, concepts and implicit ideas around it and getting a handle on the whole thing takes some effort. This blog post isn\u2019t a general introduction to OTAs but it talks about how I solved a particular problem in my understanding and spotted a mistake in one of the common write-ups.<\/p>\n<p>Digital techniques are replacing a lot of OTA applications and OTA chips are being discontinued like there is no tomorrow. One that is still available (and I use in the LushOne) is the venerable <a href=\"http:\/\/www.idea2ic.com\/LM13600\/LM13700.html\">LM13700<\/a>. While designing a voltage controlled amplifier and ring-modulator for the <a href=\"http:\/\/lushprojects.com\/lushone\/\">LushOne<\/a> I found I needed to get a deeper understanding of the LM13700 than I had had before and started to explore the behaviour of the chip in detail. In particular I wanted to be able to predict the gain when the linearization diodes are in use.<\/p>\n<p>The obvious place to turn is the <a href=\"http:\/\/www.idea2ic.com\/LM13600\/LM13700.pdf\">LM13700 data sheet<\/a>. This is kind-of famous because the designers tried to pack a lot of information and examples of their great new device in but the commercial pressures meant the datasheet needed to be kept short. It is therefore rather compactly written and understanding the example circuits is often an exercise for the reader. Initially though the case I was interested in seemed simple enough. The data sheet provides a nice equation with the glowing claim \u201cno approximations have been made\u201d.<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-254\" title=\"lm13700eq1\" src=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq1.png\" alt=\"\" width=\"323\" height=\"79\" srcset=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq1.png 323w, http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq1-300x73.png 300w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/a><\/p>\n<p>What do all the terms mean? I<sub>ABC<\/sub> is the amp bias current (pin 1 or 16). I<sub>D<\/sub> \u00a0is the diode bias current (pin 2 or 15). What is I<sub>S<\/sub> though? Fortunately Figure 1 of the data sheet tries to tell you \u2013 I<sub>S<\/sub> is the current being injected in to one input of the amplifier while the other input is grounded. So it all looks nice and simple \u2013 except that on the bench the gain I got was about half what I would have expected from this forumulat. In other words the figure of 2 in the numerator seems wrong! Getting to the bottom of this involved a lot of head-scratching and measuring and simulation. Once there the answer is obvious, but at the time it was a big mystery.<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-255\" title=\"lm13700eq2\" src=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq2.png\" alt=\"\" width=\"496\" height=\"301\" srcset=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq2.png 496w, http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq2-300x182.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p>I should say at this point that the LM13700 datasheet is absolutely technically correct, but it is rather easy to misunderstand if you don\u2019t apply your brain sufficiently. The problem lies in the interpretation of I<sub>S<\/sub> in a real configuration. Normal configuration (and I think any practical use of the LM13700) doesn\u2019t use current sources to set I<sub>S<\/sub> and I<sub>D<\/sub>\/2 at the input as shown above. You use resistors. This makes the real configuration look more like the figure below which is copied out of a couple of <a href=\"http:\/\/www.idea2ic.com\/LM13600\/UsingOTAs2.pdf\">magazine articles<\/a> by Ray Marston that crib heavily from the data sheet. Unfortunately though he has usefully shown the practical configuration the current flows shown are absolutely wrong for this set-up.<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-258\" title=\"lm13700f1\" src=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f1.png\" alt=\"\" width=\"442\" height=\"226\" srcset=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f1.png 442w, http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f1-300x153.png 300w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The problem is translating the datasheet theoretical diagram in to the real implementation. An easy thing is to assume (as shown above) that I<sub>S<\/sub> is the current through R4 and the rest of the datasheet assumptions then apply leading to I<sub>OUT<\/sub> = 2 . I<sub>S<\/sub> . I<sub>ABC<\/sub> \/ I<sub>D<\/sub>. What this overlooks is the role of the I<sub>D<\/sub>\/2 current sink shown in the datasheet figure. In the data sheet the I<sub>S<\/sub> and I<sub>D<\/sub>\/2 current sources\/sinks together force the current in one leg to be I<sub>D<\/sub>\/2 \u2013\u00a0 I<sub>S<\/sub> and this forces the other leg to be I<sub>D<\/sub>\/2 +\u00a0I<sub>S<\/sub>. When you use a resistor to ground instead of a current sink then the relationship between the current in the two legs changes and the system gain becomes different as well.<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-263\" title=\"lm13700f2\" src=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f2.png\" alt=\"\" width=\"674\" height=\"404\" srcset=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f2.png 674w, http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700f2-300x179.png 300w\" sizes=\"(max-width: 674px) 100vw, 674px\" \/><\/a><\/p>\n<p>Simulation and also careful consideration reveals then when you input a current in one leg in the practical system the effect is to increase the current flowing through both R1 and R2. Let\u2019s try and do some analysis \u2013 I have used a new term I<sub>G<\/sub> for the input current to remove confusion with I<sub>S<\/sub>. I\u2019ve also neglected any currents going in to the base of the transistors that form the differential amplifier. The voltages at the cathode (pointy end) of the two diodes (V1, V2) are approximately equal because a forward biased diode is a rough voltage reference \u2013 which means the currents I<sub>R1<\/sub> and I<sub>R2<\/sub> are also approximately equal.<\/p>\n<p>I<sub>D1<\/sub> + I<sub>D2<\/sub> = I<sub>D<\/sub><\/p>\n<p>and I<sub>D2<\/sub> \u00a0= \u00a0I<sub>R2<\/sub><\/p>\n<p>and I<sub>D1<\/sub> + I<sub>G<\/sub> = I<sub>R1<\/sub><\/p>\n<p>Therefore if I<sub>R1<\/sub> \u2248 I<sub>R2<\/sub>:<\/p>\n<p>I<sub>D2<\/sub> \u2248 I<sub>D1<\/sub> + I<sub>G<\/sub><\/p>\n<p>Or (I<sub>D2<\/sub> \u2013 I<sub>D1<\/sub>) \u2248 I<sub>G<\/sub><\/p>\n<p>and I<sub>D1<\/sub> \u2248 I<sub>D<\/sub>\/2 \u2013 I<sub>G<\/sub>\/2<\/p>\n<p>and I<sub>D2<\/sub> \u2248 I<sub>D<\/sub>\/2 + I<sub>G<\/sub>\/2<\/p>\n<p>So compared to the Marston diagram the difference in the currents is half that predicted. Assuming the ratio I<sub>D1<\/sub> to I<sub>D2<\/sub> drives the output this makes the system gain:<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-266\" title=\"lm13700eq3\" src=\"http:\/\/lushprojects.com\/blog\/wp-content\/uploads\/lm13700eq3.png\" alt=\"\" width=\"181\" height=\"70\" \/><\/a><\/p>\n<p>which fits with roughly the measured results.<\/p>\n<p>So, now do we have the missing equation for the LM13700 gain in its most common configuration? Well the answer is (very) \u201croughly\u201d! If you are on the ball you will notice that if V1 really was the same as V2 then the differential amplifier would have no differential input and therefore zero output. It is precisely the difference in V1 and V2 that drives the output! Hence the assumption that V1\u2248 V2 the above derivation is dodgy. All I can say is that from experience and simulation it seems to be OK as long as\u00a0I<sub>G<\/sub> &lt;&lt;\u00a0 I<sub>D<\/sub> and R1 and R2 are reasonably large. With R1=R2=470 Ohms then the simulated gain is about 12% less than the above formula would suggest. For my applications I always have adjustments to allow the user to set the gain and therefore the above formula is good enough to set the component vaues to give the desired range of adjustment. I suspect if you wrote out the maths properly and did the function expansions you could justify the approximations better and understand exactly how factors like the value of R1 and R2 impact the gain.<\/p>\n<p>From deconstructing what went wrong and fixing my (and it seems others\u2019) faulty assumptions I learnt an incredible amount about the LM13700 operation. What\u2019s the moral here?<\/p>\n<p>1) If a data sheet is obviously written with precision then read it with precision.<\/p>\n<p>2) If there is an interpretation trap then you may not be the only person to fall in to it!<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Update (2017)<\/strong><\/p>\n<p>You can now see the two circuits (datasheet version and &#8220;typical&#8221; configuration) simulated in the browser here:<\/p>\n<p><a href=\"http:\/\/lushprojects.com\/circuitjs\/circuitjs.html?startCircuit=ota-gain.txt\">http:\/\/lushprojects.com\/circuitjs\/circuitjs.html?startCircuit=ota-gain.txt<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you do anything with analogue syths you quickly run in to the Operational Transconductance Amplifier (OTA) as a key component. These are amps whose current output depends on the voltage difference at the inputs and a control current that scales the gain. They are used for voltage controlled filters, voltage controlled amplifiers and oscillators. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,1],"tags":[],"_links":{"self":[{"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/posts\/252"}],"collection":[{"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":19,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":463,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions\/463"}],"wp:attachment":[{"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lushprojects.com\/blog\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}