PWM controlled gain

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd like to be able to control the gain of an op amp in a range 1 - 25 from a mega32.
The circuit needs to have a frequency response DC to 10Hz. I tried using pwm to switch a resistor in and out of the feedback loop using a 4016 bilateral switch but its too jittery.
Any ideas or links? TIA.

Ralph Hilton

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of those max tapped resistors on the spi out would work.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its actually quite difficult to do with PWM, but here are some ideas:

Put the PWM logic signal into an analog switch. One side of the switch is driven with your analog signal. Filter the other side above the 10Hz bandwidth but below the PWM repetion rate. Ugly, but it should work. There will always be some PWM noise, but it can be reduced by making the PWM rate as high as possible and by increasing the number of filter poles.

Bob's idea of an SPI digital pot would let you use your op-amp circuit. These pots are fairly course (64 taps is common, 128 and 258 may also be available). Maxim is one of the main producers of these. They come in a small variety of interfaces. A few are SPI. The cheapest ones have an decoded internal counter with a count-up/count-down input; the counter sets the tap number. These beasties are also a bit expensive, especially for higher tap counts.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could try this:

Dont put the switch in the feedback loop, but fix the gain at 25.
Configure two analog switches as a SPDT switch with one pole
to ground, one pole to the input signal, and the "wiper" to a RC
filter (integrator), the output going to the op amp + input. Apply pwm to
the switches and treat them as an adjustable attenuator. Choose
the R and C values so that they will pass your signal while
blocking the pwm frequency. Should work, a circuit that does
exactly this is in the first custom design* I was paid for
after I started my company in 1976! 8-)

Tom Pappano
Tulsa, Oklahoma

* an analog computer that modulates the output of a 400kw high
frequency welding machine according to the rate of material
movement through it. The charge pump circuit is driven by pulses
derived from a stepper motor whose quadrature outputs are used
as a directional tach pickup.

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe the LM13700 can help:
It's a operational transconductance amplifier from National which can be used to build voltage controlled filters, amplifiers, oscillators, resistors, ...

Look @ page 8 of
Datasheet LM13700

You could filter your PWM signal to get an analog signal to drive the LM13700. :D
Hope this helps,

Regards,
- - big bang - -

Take a good look around. Admire our world, our galaxy, the whole universe. Then you just feel there must be a
'Theory of everything'

Maybe, someday, the human race is ready to discover it.