How can I convert a square wave signal from -15V to 15V to a positive DC signal?
Here are the details of my problem:
I'm trying to build a duty cycle for a buck converter in the following way: I want to compare (with an op amp) a DC signal with a sawtooth signal. When the DC signal is near the amplitude of the sawtooth signal => duty cycle will be high. When the DC signal is near 0V => duty cycle will be low.
So far, when I need a high duty cycle, ratter than a positive DC signal I have a square signal from -15V to 15V. I'll spare you the details but I have to deal with that input and can't expect anything else.
The easy solution would have been to have a signal between 0 and 15V and take the average with a low pass filter (then I would have a positive DC ouptut), but it isn't possible, I have to deal with a -15V 15V signal (thus I get a ~0V output, which is of no use since I also have a ~0V signal when I need a low duty cycle.) In fact, I have at my disposal only op amps powered by -15V 15V, thus I'm not seeing an easy way to get a positive DC signal from that.
Here are the components I have at my disposal: Resistors, capacitors, -15V/15V power op amps, diodes, electronic switches, buck converter.
For further detail, here is how I produce the 0V signal from 2 signals in phase (when I need a low duty cycle) so far:
And here is how I produce the square signal from 2 signals out of phase (when I need a high duty cycle):
also have a ~0V signal when I need a low duty cycle- I thought input was square wave and output a positive DC signal? \$\endgroup\$
2 square signalsThis question could significantly improve with a graph of input and output signals showing their relation. \$\endgroup\$