Why my attenuator is amplifying instead?


I have begun working on designing a voltage-controlled attenuator amplifier, seen here

Unfortunately, I'm encountering the problem that my attenuator seems to be amplifying the output voltage. At least, that is what a time domain analysis of the voltage on the load tells me...

I have done the math for a couple of different values of the dynamic resistance, and with all of the resistance values in the attenuator I do not see how it can be boosting the amplitude of the signal.

Any advice you can offer me would be greatly appreciated.

Thank you

by ConnorBecz
September 30, 2020

Since my original post, I made some changes but they did not solve my problem. The attenuator no longer boosts the input signal, but neither is it delivering any attenuation. The only "attenuation" happening seems to be the small voltage drops of the component resistances. Of course, this circuit is supposed to work by delivering an increasing degree of attenuation as the input signal increases in amplitude. So, it remains broken...

Also, my changes caused a bizarre new problem where the amplifier no longer seems to amplify the signal. It comes out the other end of the amplifier at the same amplitude as it went in. Even worse, for some reason there is a massive voltage drop of a full order of magnitude after the current crosses the output resistance. I had no idea why this should be since I specified the resistances of the amplifier for an almost "ideal" voltage gain.

All advice is welcome

by ConnorBecz
September 30, 2020

Although I seem to have made some progress with my latest updates, I am still a ways away from having a firm grasp on my circuit.

I made this new version during lunch and found that, unlike the other version, it performs the basic operation of attenuation and amplification successfully.

It still needs heavy tweaking in order to get it to operate according to useful parameters, and all advice is welcome!

by ConnorBecz
October 01, 2020

I have a totally new design, overhauled to reflect a different philosophy although I am not going to be doing actual analysis of the elements until tomorrow.

My first, indeed nearly careless pass is to rejigger the values of everything to get them current-boosting. w/ notable exception where it comes to the small current imposed on the diode.

Just a start, cannot figure right now whether more or less than this is going to be better.

All advice welcome and appreciated. I did encounter one painful obstacle. Suddenly I can't get the circuit to simulate! It just tells me it cannot read point "Y" of null. I have no idea what it could be talking about, so please all input greatly welcome to fix this...

by ConnorBecz
October 02, 2020

I'm "late to the party" on this one; hope that you are still experimenting!

The short answer, as far as I can see, to your question on attenuator/amplifier, is lack of sufficient DC bias in diode dr.

I've gone back to your first post and circuit, as I couldn't quite understand your goals from the later posts.

My longer answer is in the circuit below, which aims to clarify the operation of the diode dr used for attenuation.

Does this circuit agree with your aims for the attenuator? Hope it helps with clarifying analysis.


by EF82
October 16, 2020

Thanks for useful information in your answer, I now have a much clearer idea of your goals and methods. To summarise what I have found so far, here are a couple of suggestions for areas to work on when you return to this circuit.

AC/DC separation For this part, keep the feedback loop open - I'll cover the loop in the next part.

If you do a DC solve (or DC sweep) with the battery bias between, say, 1.4v and 10.4v, you will find that the diode dr's anode voltage rises by about 100mV. The large value of C2 (with Ri) effectively DC-couples this voltage change into the + input of the amp for 1000's of seconds. 100mV swamps the AC input of 500uV, also giving unwanted positive DC feedback.

Consider this configuration change, to provide common-mode DC to the amp, now refering to my circuit https://www.circuitlab.com/editor/kvpac2xk48r3/. Remove coupling components C2 and Ri, and connect the anode of diode dr directly to the "+" amp input. Remove the corresponding impedance balancing components C4 and R4 from around D2, then connect the anode of diode D2 (node DCref) directly to the "-" amp input instead of GND.

This way of supplying the amp's input exploits common-mode rejection (of DC). You should now have a vanishingly small DC component at the amp output. AC output amplitude should now be: Vinput x attenuation x amp gain.

Loop gain To start with, keep the loop open as above.

Prepare the rectifier. You will need only one smoothing capacitor, say Ccc only. Adjust the time constant of Ccc with a new parallel resistor to be significantly longer than the input period. You may find it easier for simulation to have the input frequency at 1kHz or even 5kHz.

With the loop still open, and a fixed bias for dr of say 5.4v, adjust the amp gain to give about the same voltage at the rectifier's smoothed output.

You should now be in a confident position to close the loop and watch AGC (automatic gain control) in action (with different input amplitudes).

Post back if you want all the above in a CL schematic, but first I thought I would clarify, in words, some independent development steps. Looking forward to seeing where you get to, whenever that is in the future.

by EF82
October 22, 2020

Thanks for the advice! I am going to try and make some of these changes today. I do have some questions about what you are suggesting...

1) I see what you are saying about balancing the common-mode of the DC signal to make it effectively zero and cancelled out. I am a little confused though because I thought the DC reference mesh was just a display to represent what the circuit looked like from a DC point of view. Is that actually supposed to be a part of the operational circuit?

2) when you say "close the loop," are you referring to using a filter to average the smoothed output of the rectifier within a set amplitude range? I guess I don't know what you mean by that.

3) when you say to adjust the amp gain to give the same voltage as a "fixed bias for dr," what are you referring to when you speak of a "fixed bias?" Is there already supposed to be a fixed bias of 5.4v established somewhere else in the circuit? Or are you referring to, say, the idea that 5.4v has been chosen to be the DC bias voltage? I guess it seems like adjusting the amp gain to give the desired voltage as you suggest, would be where the "fixed bias" is established. So I'm confused if you are saying that there should already be a fixed bias before I do that.

Thank you for helping

by ConnorBecz
October 23, 2020

Good questions, all valid - here goes!

R1] In my circuit https://www.circuitlab.com/editor/kvpac2xk48r3/ I added "Not part of the operational circuit..." to clarify that the mesh was not part of the original design. Now, moving forward with the design, DC cancellation is definitely needed as additional circuitry.

R2] "Open (or break) the loop" and "close the loop" mean cut or restore the connection between the smoothed DC capacitor and the "top" of Rc (diode bias resistor).

R3] The "fixed bias" (voltage) is part of the technique (less formally "trick"!) of 0pening (breaking) the loop. This is an amount of voltage (bias current in diode dr) that will keep the circuit at a realistic - if arbitrary - operating point while the loop is open. Once you are able to balance the fixed bias with an independent smoothed DC you will be able to disconnect the fixed bias then close the loop again and have a stable circuit.

The value of 5.4v was initially a guess as I tried to reproduce what some of your design parameters and calculations might have been. It turned out to be lucky, giving (i) a bias current of 50uA, right in the middle of the datasheet graph! (ii) a diode dr impedance similar to "R" at 1k. I ran with that.

"The Loop"

dr AC voltage > amp > rectifier > smoothed DC > bias current in Rc and dr > dr AC impedance > dr AC voltage > repeat

An increase in dr's AC voltage (for whatever reason) will propagate around the loop in such a way as to try and decrease itself - this is negative feedback.

by EF82
October 24, 2020

Wow, thanks EF82! I was missing some very important subtleties as it relates to the differential and common-mode of the input signal to the amp. I had never thought about whether or not the signal was balanced between both terminals.

Thanks for cluing me in! I do still have one big question about the circuit. I originally took the idea for this design from my EE textbook. The textbook described this type of circuit and I decided to try and build it. In my textbook, it said that there should be an RC filter after the output of the rectifier "so that the attenuation responds to the average signal amplitude rather than adjusting too rapidly." I am wondering what they meant by this, since my first thought is a lowpass filter and I cannot think of why that would be needed in this circuit...

by ConnorBecz
October 24, 2020

Looking at "... RC filter after the output of the rectifier ...". In your circuit context I think this means the parallel combination of Ccc and Rf. Some examples of component value constraints vs. time constants in different applications might help.

  • Linear PSU output smoothing. Ccc is large in order to reduce ripple. Rf is also large so as not to waste power while providing a discharge path for Ccc at switch-off (if the load is disconnected).

  • AM radio receiver demodulator / detector. Ccc and Rf are chosen to give a time constant longer than the AM carrier period. This short time constant allows audio frequency amplitude changes to be tracked closely.

  • Audio AGC / compression. Ccc and Rf have to be carefully chosen for a time constant longer than the lowest audio frequency, but short enough to track a quiet sound soon after a loud sound.

Your circuit is closest to the last of these application areas. An LP filter also provides stability against oscillations (uncontrolled fluctuations of attenuation level).

My further suggestions below are based on a version of your circuit /9pz9dj2r86pr/voltage-attenuated-amplifier/ that I copied at around 01:00 UTC 26/OCT. I've put the feedback time constant at 10mS. The rather odd-looking Step input circuitry gives interesting Time Domain sim graphs.

Your circuit is looking really good now. Hope that you will have time to "tweak" some values in order to study the effects on attenuation levels and response times. Happy experimenting!

by EF82
October 26, 2020

Now public:


by EF82
October 26, 2020

1 Answer

Answer by ConnorBecz

Thanks for sharing EF82, your circuit is what I am trying to accomplish in the attenuator portion of my circuit.

I am going to come back to working on this schematic soon. When I originally drew up the circuit, I actually did build it with a DC battery as the bias source. However, what I am actually aiming for is to have the DC bias voltage come from the amplifier output signal. Essentially, I want to have the amplifier output pass through a separate rectifier/RC filter and then come through the diode as a DC voltage to bias it.

I guess I am wondering why my original circuit doesn't perform that function. That is what I am trying to figure out and I will post again when I come back to working on this.

Thanks for your help!

+1 vote
by ConnorBecz
October 20, 2020

Your Answer

You must log in or create an account (free!) to answer a question.

Log in Create an account

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

Search Questions & Answers

Ask a Question

Anyone can ask a question.

Did you already search (see above) to see if a similar question has already been answered? If you can't find the answer, you may ask a question.

About This Site

CircuitLab's Q&A site is a FREE questions and answers forum for electronics and electrical engineering students, hobbyists, and professionals.

We encourage you to use our built-in schematic & simulation software to add more detail to your questions and answers.

Acceptable Questions:

  • Concept or theory questions
  • Practical engineering questions
  • “Homework” questions
  • Software/hardware intersection
  • Best practices
  • Design choices & component selection
  • Troubleshooting

Unacceptable Questions:

  • Non-English language content
  • Non-question discussion
  • Non-electronics questions
  • Vendor-specific topics
  • Pure software questions
  • CircuitLab software support

Please respect that there are both seasoned experts and total newbies here: please be nice, be constructive, and be specific!

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.