Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created December 2, 2025 20:41
Show Gist options
  • Select an option

  • Save ericfont/0070bcbd08789e07bea6ff62c07f7fb0 to your computer and use it in GitHub Desktop.

Select an option

Save ericfont/0070bcbd08789e07bea6ff62c07f7fb0 to your computer and use it in GitHub Desktop.
try delta double integration again
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

the signals when changing from one rail to the other:

image

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

So it seems once its has decayed enough so that the top of the 2nd-integral signal no longer clips, then that triggers the resumption of proper integration...but what happens is the decay keeps on happening and actually over shoots and hits the other rail.

To lessen likelihood of entering this situation, should always DC block the input signal.

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

zoomed out a bit:

image

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

If instead did two RC low pass filters in series, then I'd think at least the "integration" would always remain around the middle voltage, so wouldn't have this rail hitting issue. The capacitors would always be keeping the proper voltage. Would still need an opamp afterwards to amplify the signal so it is the same amplitude range as the input signal.

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

but if try two RC integrations, then get not so great frequency spectrum:

image

There is a 3rd harmonic. So the question I need to investigate is can I get rid of that harmonic with RC and just deal with RC-only, without having to even involve opamp? Or is the issue something else that can be avoided in some other manner?

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

the pwm seems to be close to 50% during rail transitions:

image

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

ADC 2nd integration (yellow) also hits the rails

image

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

image

@ericfont
Copy link
Author

ericfont commented Dec 3, 2025

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment