Author Topic: Log amplifier - oscillation  (Read 7540 times)

0 Members and 1 Guest are viewing this topic.

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Log amplifier - oscillation
« on: November 08, 2015, 10:28:41 pm »
Hi,
I am trying to make log amplifier, with op amp and transistor.
op amp = LM358
npn bjt = BC547B
V = +/- 5V
input signal = 1kHz, triangle, Vpp=1V, offset=2V

The 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.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22381
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Log amplifier - oscillation
« Reply #1 on: November 08, 2015, 10:39:30 pm »
Try adding some C-E capacitance, maybe a load resistor from OUT to -5V (1k would be enough).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #2 on: November 08, 2015, 10:57:24 pm »
I put 1k over output, and 100nF over C-E, it looks much better, but still too much of noise :(
 

Offline KJDS

  • Super Contributor
  • ***
  • Posts: 2442
  • Country: gb
    • my website holding page
Re: Log amplifier - oscillation
« Reply #3 on: November 08, 2015, 11:33:42 pm »
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.

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #4 on: November 09, 2015, 07:18:43 am »
Sure I made that circuit in LTspice, but there was no oscillation at all :(
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Log amplifier - oscillation
« Reply #5 on: November 09, 2015, 07:52:00 am »
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.

 
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline KJDS

  • Super Contributor
  • ***
  • Posts: 2442
  • Country: gb
    • my website holding page
Re: Log amplifier - oscillation
« Reply #6 on: November 09, 2015, 07:54:45 am »
Sure I made that circuit in LTspice, but there was no oscillation at all :(

What phase margin does your model show?

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Log amplifier - oscillation
« Reply #7 on: November 09, 2015, 08:03:27 am »
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.
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #8 on: November 09, 2015, 08:39:05 am »
Thanks for pointing me towards power supply. That was the problem. I put some caps across rails and problem seems to be solved :)
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Log amplifier - oscillation
« Reply #9 on: November 09, 2015, 08:53:54 am »
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.

 
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #10 on: November 09, 2015, 08:58:39 am »
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.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Log amplifier - oscillation
« Reply #11 on: November 09, 2015, 12:38:53 pm »
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

   
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #12 on: November 09, 2015, 07:09:27 pm »
I know there are nice log amplifier ICs.
But
1. 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.pdf

Another 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.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Log amplifier - oscillation
« Reply #13 on: November 09, 2015, 08:30:09 pm »
I know there are nice log amplifier ICs.
But
1. 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.pdf

Another 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.
You 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.
« Last Edit: November 09, 2015, 08:32:28 pm by Kalvin »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22381
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Log amplifier - oscillation
« Reply #14 on: November 10, 2015, 12:36:00 am »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #15 on: November 10, 2015, 07:07:53 pm »
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.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22381
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Log amplifier - oscillation
« Reply #16 on: November 10, 2015, 08:51:22 pm »
Volts and amps are volts and amps: it works for either.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3322
  • Country: gb
Re: Log amplifier - oscillation
« Reply #17 on: November 10, 2015, 09:28:41 pm »

2. I am learning and it is difficult to say whether such ICs will accelerate my learning curve or not.

When 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.
 

Offline ChupacabrasTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: sk
Re: Log amplifier - oscillation
« Reply #18 on: November 10, 2015, 09:32:20 pm »
You are right.
I think I will use suggested multiplier AD633. That is exactly what I need for my project.
 

Offline IconicPCB

  • Super Contributor
  • ***
  • Posts: 1546
  • Country: au
Re: Log amplifier - oscillation
« Reply #19 on: November 10, 2015, 10:12:27 pm »
I thought they had constant gain bandwidth product with variable gain hence variable bandwidth...a hairy proposition
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Log amplifier - oscillation
« Reply #20 on: November 10, 2015, 11:16:19 pm »
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.

They 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.
,
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Log amplifier - oscillation
« Reply #21 on: November 11, 2015, 05:51:39 am »
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/#msg609959

In reply #309 I gave the preliminary details/simplified schematic of the anti-log module.

 
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf