Inverting PWM of unknown amplitude

Thread Starter

willbryce

Joined Nov 25, 2016
6
I'm flummoxed as to how to invert a low-power PWM signal going from 0V to an unknown voltage (less than 18V). The output voltage amplitude needs to be the same referenced to 0V.

In other words, where the input signal goes from 0V to xV and then to 0V, the output goes from xV to 0V and then to xV.

Seems like a simple problem but, maybe lacking experience, I can't find a solution.

I seek expert advice. If it can't be done relatively simply, then please tell me and I'll admit defeat.

But a solution would be greatly appreciated!
 

Dodgydave

Joined Jun 22, 2012
11,395
Depending on your voltage level, you can use an inverter chip like a Cd 4049, or Cd4069 series, otherwise its a transistor like a fet or bipolar.
 

shteii01

Joined Feb 19, 2010
4,644
You say that amplitude of the pwm signal is unknown, but less than 18 volts. Is it really unknown? Or is it adjustable with the maximum of 18 volts?

You may have to run the pwm signal through series of led to figure out its amplitude (if it is not too fast). Then run it through inverter. Probably will need two stage inverter.
 

Thread Starter

willbryce

Joined Nov 25, 2016
6
Pardon my ignorance, but I don't see how such an inversion would retain the original voltage amplitude. Perhaps I'm being a bit thick and you could give me an an example circuit.
 

shteii01

Joined Feb 19, 2010
4,644
Depending on your voltage level, you can use an inverter chip like a Cd 4049, or Cd4069 series, otherwise its a transistor like a fet or bipolar.
^ what they said. Just use inverter cd4049. It got maximum supply of 18 volts. Just power it with 17.5-17.8 volts, then run your PWM signal through it.
 

shteii01

Joined Feb 19, 2010
4,644
Pardon my ignorance, but I don't see how such an inversion would retain the original voltage amplitude. Perhaps I'm being a bit thick and you could give me an an example circuit.
It will retain the original voltage amplitude because it can be powered by 18 volt supply. Since your limit is sub 18 volts, you said it yourself, whatever you put in, will come out, but be inverted. If you put in 0-12 volt pwm signal, 0-12 volt will come out, only inverted.
 

Thread Starter

willbryce

Joined Nov 25, 2016
6
To earlier replies, the unknown voltage is variable and cannot be pre-established.. The circuit just wants to invert it at the amplitude at which it is supplied.

Is this really beyond the wit of man?
 

Thread Starter

willbryce

Joined Nov 25, 2016
6
shteii01, you said ..
It will retain the original voltage amplitude because it can be powered by 18 volt supply. Since your limit is sub 18 volts, you said it yourself, whatever you put in, will come out, but be inverted. If you put in 0-12 volt pwm signal, 0-12 volt will come out, only inverted.

My apologies. I'm amazed. I'll take your advice and try this out although I can't say that I understand it. But what's new!

Many, many thanks, my friend. I am indebted to you.
 

#12

Joined Nov 30, 2010
18,224
Doesn't the non-inverting input of your second op-amp need to at half the peak voltage to make this work?
If you want the output centered on 0 volts, you don't need the peak detector. Just run the signal through an inverter, resistor in series, capacitor to ground, and viola...inverted signal centered on 0 volts.
 

AlbertHall

Joined Jun 4, 2014
12,636
With this circuit and a 0v to 18V PWM input, the capacitor will be charged to 18V. When the input is at 18V, the output will be 18V, and when the input is at 0V the output will be 36V. Feeding half the peak voltage to the second op-amp makes it work correctly.
 

#12

Joined Nov 30, 2010
18,224
There is something seriously wrong, but I am struggling about how to fix it.
Is this your idea?half peak input.png

By golly, I think I see where you're right!:)

All that is left to do is to size the resistors high enough to not load down the input signal and size the capacitor for the correct time constant for the frequency needed.
 
Last edited:

#12

Joined Nov 30, 2010
18,224
I guess I never did that circuit before. It took me 3 tries to figure out why half voltage was the right answer.:(
Probably something about getting old.:D
I mean, straight invert from a peak detector? Why would that pivot about the center of the peak voltage instead of zero?
Well, it does. I just got fooled.:oops:
 
Top