Remove DC bias from a square wave

Thread Starter

electrophile

Joined Aug 30, 2013
167
8V is your power supply for the sensors, it has to supply 12mA per sensor - a resistive divider won't cope with the change in current. I'd suggest a LP2951, which is about the most accurate voltage regulator available.
I don't quite see why it is so precious about the supply voltage (8.0V +/- 0.02V) - seems absurdly accurate for the application.
Thanks!
 

Thread Starter

electrophile

Joined Aug 30, 2013
167
UPDATE: I finally built this using the schematic shown below. On the test points (TP12 and TP14) I see the output swinging between 0-12V. Since I needed to interface this with an MCU, I scaled the output down using a resistor divider and then added a 3.3V zener clamp at the output. This works, however, ENC1_A/B is 2V instead of 3.3V. Is this the right way to scale down the opamp output?

Screenshot 2021-01-26 at 19.42.32.png
 

Ian0

Joined Aug 7, 2020
9,846
At a current that low 12V /100k = 120uA a 3.3V zener will not give you 3.3V. It will only give 3.3V at its rated current (probably 5mA). Leave out the zener - the resistive divider will limit it to 3.3V and doesn't need any help from the zener.
I think I would have used a comparator with an open-collector output such as the LM393, and used a pull-up to 3.3V to avoid the divider, but what you have done works, provided that your 12V supply is reasonably accurate and stable.
 

AnalogKid

Joined Aug 1, 2013
11,056
The output sag could be due to loading. An ENC1_A or B load equivalent to 40 K, which appears in parallel with R150 or R158, will cause such a sag.

I would decrease R149 and R157 to 10K, delete R150 and R158, and retest.

ak
 

Thread Starter

electrophile

Joined Aug 30, 2013
167
At a current that low 12V /100k = 120uA a 3.3V zener will not give you 3.3V. It will only give 3.3V at its rated current (probably 5mA). Leave out the zener - the resistive divider will limit it to 3.3V and doesn't need any help from the zener.
I think I would have used a comparator with an open-collector output such as the LM393, and used a pull-up to 3.3V to avoid the divider, but what you have done works, provided that your 12V supply is reasonably accurate and stable.
You are right. I did not take into account that the zener would not operate at that low a current. Using the LM393 is a good idea but I've already ordered the NCS20072 in quantity so I'll stick with it for now. Maybe for the later revisions.
 

Thread Starter

electrophile

Joined Aug 30, 2013
167
The output sag could be due to loading. An ENC1_A or B load equivalent to 40 K, which appears in parallel with R150 or R158, will cause such a sag.

I would decrease R149 and R157 to 10K, delete R150 and R158, and retest.

ak
Yes that would work too although the resistor might need to be around 1K as it would then fit in the standard operating range of the zener (12-3.3)/1000 = 8.7mA. I'll do some testing later tomorrow.
 

AnalogKid

Joined Aug 1, 2013
11,056
I see no reason to overburden the opamp output stage with such a high zener current.

What is the source / rationale for your calculation?

ak
 

Ian0

Joined Aug 7, 2020
9,846
Zener diodes don't do instability (unlike the gas discharge tubes which preceded them, which had a negative resistance region in the transfer characteristic and could turn into a relaxation oscillator).
You should find a rated current, a maximum current and a slope resistance in the datasheet.
The current limit is thermal - exceed for more than a few milliseconds and it will melt and go short circuit.
The rated current is the current at which you will get the rated voltage.
You can use them at any current, but you'll only get the specified voltage at the rated current.
You can estimate the voltage at any other current by:
Voltage = Zener voltage + (Actual current - Rated current)*slope resistance.
It's an estimate, and assumes the slope resistance is constant, which it isn't.
Low voltage zeners (below 4V) make good guitar distortion circuits and are pretty much hopeless for anything else - so much so that I'm surprised that they are still made. Surely all the world's production of 2.4V zeners doesn't end up in guitar pedals?
 

ericgibbs

Joined Jan 29, 2010
18,872
hi electro,
The 100k's and 39k's on the output clamp are much to high in value, consider a total series resistor value in the order of low kOhms.

E

What maximum voltages do you measure at T12 and T14.??
 

ericgibbs

Joined Jan 29, 2010
18,872
The 10k did not work. Getting 3V with 1K.
Hi e,
So what are the upper and lower resistance values in the output dividers.?

What maximum voltages do you measure at T12 and T14. on the amplifier outputs??

E
 

Thread Starter

electrophile

Joined Aug 30, 2013
167
OK - - - - - What is the voltage without that connection? If the MCU assembly has a 10K pull-down resistor at its input pin to prevent problems when something is disconnected, that would explain your findings.

ak
Can’t disconnect it since it’s on a PCB. The MCU (STM32F407) is configured in encoder mode and there is an internal pull up, I think its about 40kohm.
 
Top