Go Down

Topic: Doubling pwm output voltage. (Read 13451 times) previous topic - next topic


Why is r2 insignificant?

It connects the output back to the -ve input, it does nothing else. This is the same as if you just used a wire to do it.
It can't control the gain. It there were an other resistor from the -ve input to ground then it would control the gain as it is it doesn't (unless it were a transconductance amplifier which it isn't).

On all first order op amp filters I've seen R2 is used for gain.

Not like that you haven't.

Code: [Select]
Also what second order filter would you suggest?
There are many but perhaps the simplest is the Butterworth, it has a nominally flat pass band and rolls of smoothly all the way down. More complex designs (in response not component complexity) would be a Chebychef or a Cower, these have ripple in the pass band and stop band or nulls in the pass band but you pay for it by ultimately having a lower absolute stop band.

ust two op amps back to back? or a biquadratic?

No a second order filter is normally characterised by having frequency dependent components in the feedback loop. You could do this with two first order RC filters separated by op amps but that is a waste of op amps.

There are two things when you consider filter design, first what sort of filter response you have / need and secondly how you implement that as a circuit. The two are mainly independent of one another.


Apr 23, 2009, 03:34 pm Last Edit: Apr 23, 2009, 07:25 pm by darudude Reason: 1
Sorry this is what I meant! Just looked back at my notes from school and I was pretty damn wrong. FOr some reason I thought the filter was part of the op amp, I didn't realise the op amp was just a voltage follower:

Would this be an active second order filter? It is the Sallen Key topology:

I know you should be able to do all this using just an active low pass filter, but I don't know which filter to use (Sellen-Key? Biquadratic?) and what parameters (What is the 3db Frequency?)


First diagram:-
You can see that as the frequency gets higher the effective resistance of Cf in parallel with Rf gets smaller and so the gain of the inverting amplifier gets smaller. At low frequencies the gain is given by the ratio of Ri to Rf. However there is a single RC controlling the response and so it's roll off is the same as a simple RC.

Would this be second order?

Yes there are two capacitors rolling off the response with frequency one on the input and one in the feedback.
Sallen Key is the name of the way you implement the second order filter or as you say the topology.
The Q and roll off frequency give the filter characteristics you would put two of these one after the other to get a 4th order filter but the roll of frequency ohamaga o would be different for each block as would be the Q.
Determining these two parameters for cascaded circuits is what filter design is all about.
In the case of PWM the roll off frequency would be set to the maximum speed you wanted to change the DC voltage. Then the distance away that the modulating frequency was would give you how much carrier signal you would get on the wanted DC signal.

I am sorry that this has got a bit more complex than answers normally do on this forum but filter design can be quite exacting.


I am sorry that this has got a bit more complex than answers normally do on this forum but filter design can be quite exacting.

Don't apologize! This is exactly what I wanted. I should be thanking you instead!

At school they make filter design a joke cause they give you all the parameters(3db freq is this, roll off is this, gain is this, bode plot is this). However, now that I want to implement a solution in the real world I am all confused. Therefore all this information really helps me. If you get to it, I would love a full blown filter design tutorial. I'm sure a whole bunch of us would appreciate it! Thx a lot.

Vancouver Reefer

So back to my initial question. If i use this circuit:

and i replace R2 with a link, i will be able to get the arduino to control 0-10v pwm???

I hope im on the right track with what everyone is saying???



Apr 23, 2009, 07:23 pm Last Edit: Apr 23, 2009, 07:24 pm by darudude Reason: 1
Vancouver: nope. you will get an analog value but it will be between 0 and 5. You need another op amp to double your gain.

Add this opamp at the end of your circuit:

Vin is your current Ballast output.

Rf and Rin are 10k
Rz is approx 5k (this is really not that important, you should be able to replace this with a short)
and Vout is what goes into your ballast

Also I would use 12 V as your supply voltage

Vancouver Reefer

I think im following:

So by adding the second op amp that increases the gain of the first op amp, hence allowing more voltage to be controlled??

And why upping the supply voltage to +/- 12v if im only going to be controlling 0-10v on the ballast. Isnt 12v too much????



Depending on the op-amp, it will only be able to drive the output within a volt or so of the power supply rails.  The actual output voltage is determined by: (input voltage) * (op-amp gain)


Vancouver: you almost got it. you still have to have a short between the  - of the first op amp and the + of the second op amp.

Keep in mind, if you still get some flickering in your ballast, you might have to play with your R1 and C values. Your r2 and your r3 values are good though.

Depending on the op-amp, it will only be able to drive the output within a volt or so of the power supply rails

Yeah thats why I told him to change the op amp supply voltages from 10 to 12 V


WOW!  I miss a few hours and the world changes!  ;)  This is great stuff!  I really like the Op Amp solution.

Just curious, would you really need the second Op Amp to adjust the gain?  Couldn't you just use the feedback loop from the second Op Amp on the first one?  Or, if you needed to drive a low impedance load, could you use the gain of a transistor or FET in stead of another op Amp?

The weekend is coming.  I may have to bury myself in the garage and do some bread boarding.   :D

Vancouver Reefer

Ooopppps Well Spotted darudude!!!

So here is the final circuit:

And i may need to play with the R1 and C values to stop the flicker! I got it!!!  I take it the use of LM741's will work ok for this?


Apr 23, 2009, 08:48 pm Last Edit: Apr 23, 2009, 08:49 pm by retrolefty Reason: 1
I take it the use of LM741's will work ok for this?

LM741 might work but that opamp is from the Jurassic age (although not as old as me  ;)), a cmos op amp like the TI-07X would be much better. It's also possible with a few biasing tricks and supply wiring  to do away with the negative voltage supply requirement.



koyaanisqatsi: I wasn't sure whether the voltage follower was needed or not, so I slapped it in there for good measure.

However, now that I look at it, since the voltage is going into the positive channel, you should be able to eliminate the voltage follower (first op amp). In fact, now that I think about it, if the voltage follower was to help at all, it would help more if it was after the gain amplifier.

You are right the gain can be handled by a FET (BJT will not work), but then he'd need to create a 10V source so I stuck with the op amp solution.


Yes on that last circuit get rid of IC1 and feed what was going into the +ve input into the +ve input of IC2. That way you combine the function of the high impedance input of the IC after the RC filter part with the gain of the second IC.
You can get op amps now that go from rail to rail, that is get the full swing out of one.

[size=14]Nostalgia waning[/size]
that opamp is from the Jurassic age

Not quite it was the second popular op amp, I think the first was the 709 (it's late at the moment so I might be wrong) but you had to add an R and C to stop it oscillating. With the 741 there was internal compensation so you didn't have to add anything. I remember booking a lot (20) of 741's out of stores when I was 21 back in 1973, it was the equivalent of a weeks wages then.

Vancouver Reefer

Grumpy Mike is this what you mean:


I tried searching for the TI-07X but search turned up nothing on Mowser with that??????


How did the breadboard playing turn out?????

Go Up