Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created March 15, 2025 07:04
Show Gist options
  • Save ericfont/497157bf60d048dbb9e6ed6ffdc01246 to your computer and use it in GitHub Desktop.
Save ericfont/497157bf60d048dbb9e6ed6ffdc01246 to your computer and use it in GitHub Desktop.
double-buffer-and-offset-compensation (intended for MCP6004 with +/- 30mV offset) for buffer complementary decaying exponentials centered about 2.5V
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

The comparator has its own offset. So what really need to do is add an offset to match the comparator's offset from 2.5V rather than trying to remove all offset from these opamp outputs.

It may be best to first have an uncomplicated unity gain opamp buffer, that way the generation of the discharge curve will be unaffected by any considers other than its single R and C. Though that buffer will produce an offset, two subsequent inverting opamps for pos and neg versions of curve can be configured to get their offset to exactly equal the offset of the comparator.

@ericfont
Copy link
Author

Actually instead the comparator should get its own opamp that buffers 2.5V but with an offset opposite of the comparator's offset. This opamp and compensation needs to be setup first because will be then used to test compensation of all the other opamps.

@ericfont
Copy link
Author

Maybe use jfet as voltage controlled resistor calibrated RC decay.

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