I'm trying to build a circuit that will have an input DC signal. I know there is a stead DC offset in the signal, and want to subtract it. I do not know if the input signal is positive or negative. If it is positive, I need to subtract the DC offset, and if the input is negative then I need to add the AD offset. Is there any circuit or way to do this? The only way I can think of is using a switch that would go between a summing op-amp or differential op-amp that needs to manually be switched after someone manually checks if the input is positive or negative.
Any dc offset (that's the word) that you want to remove can be simply done with a high pass RC filter: -
If your actual signal has a dc value that you want to pass through the circuit then you could use an instrumentation amplifier because it has a pin that your can use to set-up a DC offset that counters the DC offset you want to remove: -
You pretty much drive it like an op-amp but pin 5 (reference) can be set-up with an offset voltage that biases your real signal in one direction or the other.
If the offset is always the same magnitude and it's polarity is dependent on the polarity of the input then you can use the same idea to invert or not invert that offset depending on the polarity of the input. Use of a precision rectifier would help in determining the polarity of the signal and this can be used to switch either the positive offset or the negative offset to pin 5 of the instrumentaion amplifer. Analogue switches are probably a good choice for the selection of the offset source.
Figure 1. Bipolar DC offset remover.
This circuit might do what you want.
- OA1 is configured as an inverting summing amplifier. The output will be -1 times the sum of the inputs on R1 and R2.
- OA2 is a comparitor. If the '-' input goes positive the output will switch to the negative rail. If the '-' goes negative the output will switch to the positive rail.
- R3 gives you the ability to adjust the amount of correction.
- OA2 may not get as close to one rail as the other. This will affect the amount of correction on each side. To fix that you may need to add a resistor and pair of back to back zeners to clamp the voltage symmetrically before it gets to R3.
- Using an op-amp for OA2 as a comparator it may latch up and cause a slight delay at high frequencies. The concept should be enough for you to work out a better solution if required.
- Vout will be inverted. If you need it the right way up then add a second inverting stage after Vout.