Electrical – How to block DC of triangle waveform from 555 powered by single supply

555analoghigh pass filter

I'm using a 555 timer to generate a triangle waveform with a DC offset. I would like to feed the waveform into a comparator along with an AC signal with zero offset to get a PWM signal, so I need the average voltage of both waveforms to be equal. I'm trying to do this with an DC coupling capacitor to make the triangle waveform centered around 0V, but I'm only getting negative voltage after the capacitor. Why is this happening? How can I get a triangle waveform from the 555 with zero DC offset?

Here is the schematic:
555 Triangle Generator

Here is the voltage after C7. It has a ~-3.7v DC offset for some reason:
enter image description here

Best Answer

C7 and R5 make an RC high pass filter with a cutoff frequency of .16 Hz and an RC time constant of ~1s. In order to have no DC offset, the capacitor must charge which takes \$5\tau\$ to reach 99% charge, or 5 seconds in your case.

To see the removal of the DC offset, you either need to simulate your circuit for 5s, or use a filter with a higher cutoff frequency. Since it looks like your circuit has an output frequency of ~200 kHz, a .16 Hz high pass filter is not really suitable (and probably wouldn't work well with an electrolytic cap), and you really should use a filter with a much higher cutoff frequency, say 20 kHz.