I mentioned this problem in post #46. Attached is how I would deal with the drift. I don't remember exactly what your range of pulse widths is. I put in a couple of single-pole filters with ≈1mS time constant. You might have to change those. Also, you can change the ranges on gain, threshold, and hysteresis.
I did not attempt to filter out 120Hz, so if you have not solved that problem, it would still have to be dealt with.
I included the .ASC file, in case you want to simulate it on LTspice.
Hi Ron H,
For some reason the .asc file shows a different circuit that the .png file. Which is the correct one?
Thanks
Neptune24.