Log amplifier - oscillation - Page 1
Forum section: electronics / beginners

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 08, 2015, 10:28:41 pm
content: Hi,I am trying to make log amplifier, with op amp and transistor.op amp = LM358npn bjt = BC547BV = +/- 5Vinput signal = 1kHz, triangle, Vpp=1V, offset=2VThe response is weird, it looks like oscillation, but I don't know why.When I use just diode instead of transistor, log amplifier works OK.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 08, 2015, 10:39:30 pm
content: Try adding some C-E capacitance, maybe a load resistor from OUT to -5V (1k would be enough).Tim

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 08, 2015, 10:57:24 pm
content: I put 1k over output, and 100nF over C-E, it looks much better, but still too much of noise

author: KJDS
author_rank: Super Contributor
timestamp: November 08, 2015, 11:33:42 pm
content: It's one of electronics oldest truths that if you design an amplifier it will oscillate, but if you design an oscillator it won't.You'll need to do a stability analysis to make sure that an amplifier amplifies and not oscillations. Putting together a bode plot in LTSpice or similar will be a useful exercise.

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 09, 2015, 07:18:43 am
content: Sure I made that circuit in LTspice, but there was no oscillation at all

author: GK
author_rank: Super Contributor
timestamp: November 09, 2015, 07:52:00 am
content: The compensation cap needs to go between Vo and V- of the op-amp. Start with 1nF and work down.Note that this topology when compensated has poor/slow transient response to large dynamic range input changes, as the output can't slew any faster than what the low-level input current can charge the compensation capacitor.

author: KJDS
author_rank: Super Contributor
timestamp: November 09, 2015, 07:54:45 am
content: Quote from: Chupacabras on November 09, 2015, 07:18:43 amWhat phase margin does your model show?

author: Kalvin
author_rank: Super Contributor
timestamp: November 09, 2015, 08:03:27 am
content: Do you have bypass capacitors in place? Is your power supply clean? The noise frequency look quite high which makes me suspect that the noise would come from somewhere else (from the power supply perhaps) than LM358 oscillating.

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 09, 2015, 08:39:05 am
content: Thanks for pointing me towards power supply. That was the problem. I put some caps across rails and problem seems to be solved

author: GK
author_rank: Super Contributor
timestamp: November 09, 2015, 08:53:54 am
content: This circuit is unlikely to have an adequate/reliable stability margin with that high gain common-emitter BJT amplifier wrapped up inside the op-amp feedback loop and no deliberate frequency compensation applied.

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 09, 2015, 08:58:39 am
content: What circuit would be more suitable?I want to make electronic DC load, and one of modes is "constant power". So I need to multiply sensed voltage and current, to get value of power.

author: GK
author_rank: Super Contributor
timestamp: November 09, 2015, 12:38:53 pm
content: That circuit you are experimenting with is a typical text book theoretical circuit, but it is of limited practical use. Neither its Vbe output offset nor its scale factor are compensated for temperature. Practical "discrete" log amps use a pair of matched transistors along with a pair of op-amps and a thermistor thermally coupled to the transistor pair for scale factor compensation. The simplest option for most applications is an integrated one, like this:http://www.ti.com/lit/ds/symlink/log101.pdf

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 09, 2015, 07:09:27 pm
content: I know there are nice log amplifier ICs.But1. they are expensive. I need 2 log amps and 1 antilog for constant power mode.2. I am learning and it is difficult to say whether such ICs will accelerate my learning curve or not.My plan was to use circuit from (page 6):http://www.electronics.dit.ie/staff/ypanarin/Lecture%20Notes/DT021-4/6LogAntiLogAmplifiers.pdfAnother way is to make those calculations in microcontroller, but I don't know if it is a good idea to control op amps and power mosfets by microcontroller (digital way). I feel that analog way is better.

author: Kalvin
author_rank: Super Contributor
timestamp: November 09, 2015, 08:30:09 pm
content: Quote from: Chupacabras on November 09, 2015, 07:09:27 pmYou can accomplish this also using a multiplier circuit, something like AD633 (Approx. $9.00 from Digikey). Of course a microcontroller with a 12-bit ADC and on-chip or off-chip DAC or PWM-DAC could do the trick too, depending how fast response time is needed.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 10, 2015, 12:36:00 am
content: If you're going to use an MCU anyway, you might as well.But, use it only for assigning setpoints. Let the analog circuitry do its thing, safe and robust.Best method, build a circuit with voltage and current inputs. It regulates to whichever is highest. Doesn't know anything about power, doesn't care (except that, the maximum value for the inputs can only deliver V*I at the most). Run two DAC outputs from the MCU, to drive these. Read the actual V/I with an ADC (note that Vo != Vset when in current limit, and vice versa, so you always have an "I want this much V/I at the output" command, and an "okay this is how much V/I we're getting" response). Do the multiplication in software, and use a PID loop to adjust V or I as needed.This way, even if this MCU completely shits itself and the supply gets stuck on full output, you can't draw any more than Vmax * Imax watts, and the analog circuit is always 100% in control, regulating or limiting as it does. No transistors get harmed in the process, though things may heat up a bit (you might add a thermistor to regulate or protect against overheating, or a fuse on the supply input to eventually burn out if the current draw is, like, >3 times what it usually is). Presumably, the power limit doesn't need to respond very quickly, so it can be in a secondary loop (which will probably be >= 3 times slower than the analog V or I loops).Tim

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 10, 2015, 07:07:53 pm
content: T3sl4co1l, are you talking about "electronic DC load", or about "power supply".It seems to me you are talking about power supply. I am to build DC load, not power supply.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 10, 2015, 08:51:22 pm
content: Volts and amps are volts and amps: it works for either.Tim

author: mikerj
author_rank: Super Contributor
timestamp: November 10, 2015, 09:28:41 pm
content: Quote from: Chupacabras on November 09, 2015, 07:09:27 pmWhen would you prefer to learn that these very basic log amp circuits have terrible temperature stability and limited bandwidth, now or half way through your project? By all means experiment with them, but don't design one into a project until you know all the potential problems.

author: Chupacabras
author_rank: Regular Contributor
timestamp: November 10, 2015, 09:32:20 pm
content: You are right.I think I will use suggested multiplier AD633. That is exactly what I need for my project.

author: IconicPCB
author_rank: Super Contributor
timestamp: November 10, 2015, 10:12:27 pm
content: I thought they had constant gain bandwidth product with variable gain hence variable bandwidth...a hairy proposition

author: dom0
author_rank: Super Contributor
timestamp: November 10, 2015, 11:16:19 pm
content: Quote from: Chupacabras on November 10, 2015, 07:07:53 pmThey are identical. The only difference is that most* DC loads do not have an internal power bias, but every supply does.* except for loads that can do xxxx A at ~0 mV terminal voltage.

author: GK
author_rank: Super Contributor
timestamp: November 11, 2015, 05:51:39 am
content: Semi-discrete log amplifiers with decent speed and temperature stability can be made. I presented one design here (reply #287):https://www.eevblog.com/forum/projects/home-brew-analog-computer-system/msg609959/#msg609959In reply #309 I gave the preliminary details/simplified schematic of the anti-log module.