2
\$\begingroup\$

I am using an op amp configured as an integrator, as shown in the schematic below. There is an input signal which can go both positive and negative [+1V ... -1V], and then depending on this input signal polarity the output of the integrator will ramp up or down until it reaches the supply rail of the op amp (±12V in my application). This all works fine:

enter image description here

I would now like to use a control signal from a microcontroller (~5V DC) to be able to reset the capacitor charge to zero at any arbitrary time, and keep it shorted out to prevent further charging. I tried to do this using a simple MOSFET, as shown below:

enter image description here

As can be seen in the SPICE calculation, this doesn't work properly - the charge is reset to zero correctly, but the negative part of the waveform is now clipped. I am not sure I understand why this is the case.

Can anyone tell me what mistake I have made, and suggest a way to achieve what I am looking for? Thanks!

EDIT ------------------------------------------------------------------------

After reading Caleb's answer, I have also tried to place a switch across the capacitor (a classic toggle switch here, but in practice could be an analog switch such as the DG417, as suggested). I have also placed a 1 kΩ resistor in series, to keep the discharge current through the switch at around 10 mA, as recommended in the comments (discharge response time is not an issue or requirement for me at all):

enter image description here

However, now a new problem arises as seen above. I didn't realise the need to specify in the original question, but whenever the capacitor is shorted I would also like the integrator output to be zero, regardless if the input signal is still applied. It can be seen here that the output is non-zero, as the input resistor and series discharge resistor effectively form a potential divider. Does this mean that I also need to add some MOSFET to short the output of the op amp down to ground whenever this "discharge control signal" is applied?

\$\endgroup\$
2
  • \$\begingroup\$ If your C_discrg_ctrl is 0V and your V_IN is some negative voltage, say -5V for example, what is the Vgs (voltage between gate and source) of your MOSFET? \$\endgroup\$
    – brhans
    Sep 5, 2019 at 17:21
  • 2
    \$\begingroup\$ Due to the way they are constructed, MOSFETS have a diode between the source and drain (called the body diode). This is why the negative part behaves that way. \$\endgroup\$ Sep 5, 2019 at 17:36

3 Answers 3

2
\$\begingroup\$

Reset Switch

You should not use discrete MOSFETs for this due to the body diode. A single SPST analog switch such as the DG417 or DG9421 would be ideal for this task. These devices have a logic-level threshold and can operate over a wide voltage range due to the fact that they utilize a transmission gate.

Just one caution: you will probably want to place a resistor in series with the switch so that you stay within the maximum power rating of the part.


Zeroing the output

I would not recommend grounding the op-amp's output. Although most small op-amps will survive this, you have to consider what happens when you switch off the op-amp. During reset, the output stage will most likely saturate. This saturation will "carry" over into the next integration cycle, causing a large (and unpredictable) voltage spike as the op-amp tries to compensate for the sudden change in output current. Instead, I recommend one of the following options.

Option 1: use a smaller resistor on your reset. This will not actually zero the output. I would recommend a 220Ω resistor, since it limits the current to 100mA (the maximum 1ms pulsed current rating for the DG417) when combined with the switch resistance. This is a worst-case calculation (24V across the capacitor).

\$ I = 100\mathrm{mA} = \frac{24}{20 + 220} \$

Note that the 100mA pulse will be much shorter than 1ms. In this case the time constant during discharge is 240μs. Also, this does not actually zero your output: it forms a low-pass filter with a cutoff at 660Hz and -12dB DC gain.

Option 2: if you really need the output to stay at zero, you can always add an SPDT analog switch (such as the DG419) between the input resistor and inverting input of the op-amp. Your circuit would then look something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

If you are very concerned about transients (you probably aren't), you could use a DPDT switch that connects your input resistor to ground separately, so that the previous stage sees a constant load.


Component selection

As @Sunnyskyguy EE75 mentioned in the comments, you are going to have trouble finding a 1μF capacitor that works well in an integrator. Due to a variety of factors (dielectric absorption, leakage, temperature variations, etc.) it is best to use either a plastic film (PP/PS/PPS) or Class I ceramic (C0G/NP0) capacitor. These are generally limited to fairly small values (10s of nF max). Thus, you will want to use a smaller capacitor and larger input resistor.

One small warning: as the input resistor value increases, the input bias current of the op-amp becomes more and more significant. Using the OP07C as an example (\$I_B\$ of ±7nA), a 1MΩ input resistor will result in a 7mV offset between the op-amp terminals. This is an order of magnitude higher than the input offset voltage of the OP07.

\$\endgroup\$
6
  • \$\begingroup\$ It may have also helped to explain some of the difficulties the OP faces: channel charge injection, clock feed-through, and kT/C noise. (But without actual details about the genuine situation faced by the OP, you didn't have a context and so I'm glad you just focused on the important matter.) With discrete parts, I think the OP would find many difficulties ahead (though that level of current appears to be "huge" to me.) Anyway, +1 for suggesting the right direction for the OP. \$\endgroup\$
    – jonk
    Sep 5, 2019 at 18:09
  • \$\begingroup\$ @jonk I kind of doubt that charge injection and clock feedthrough would be an issue at the frequency shown in the simulation. The current through the switch can easily reach several amps while discharging, that's why I suggested a series resistor. Do you think I should put more information in my answer? \$\endgroup\$ Sep 5, 2019 at 18:16
  • \$\begingroup\$ I didn't assume that the OP's example circuit actually reflected their true situation. I never know for sure, of course, but I tend to leave room that an OP may post a much simplified and more behavioral example in order to force us towards an answer they think they want to see. So I didn't assume the example was accurate, or inaccurate, but instead is only what they wanted to present. But I don't think more information would help. I really do think your answer is already good enough given what the OP has shared. It was "just right." (My opinion is only that, though. Yours is as good as mine.) \$\endgroup\$
    – jonk
    Sep 5, 2019 at 18:24
  • \$\begingroup\$ I agree with @jonk since the simulation starts at 1ns. \$\endgroup\$ Sep 5, 2019 at 20:42
  • \$\begingroup\$ @CalebReister Thanks for your answer. I see from the link provided that you yourself have faced this same issue a while ago. I understand now about the body diode, and have therefore tried using a switch as you suggested, and have edited the question to reflect this. There is now another problem, which is the op amp output being non-zero. Do you have any idea how I could get around this problem? Thanks! \$\endgroup\$
    – teeeeee
    Sep 6, 2019 at 13:29
0
\$\begingroup\$

Although it is often not shown in the MOSFET symbol, they all have a diode between source and drain. This is called the body diode.

Body Diode

If the source goes more positive than the drain by more than a little bit, the MOSFET will conduct regardless of gate voltage.

You might be able to solve this by adding a second MOSFET in series with the source and drain reversed like this:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ You most likely won't be able to switch one or both of the series MOSFETs due to the fact that the source voltage is continuously changing for both of them. Using only discrete MOSFETs, the best solution would probably be to connect both sources to ground and the drains across the capacitor. However, this will also short the op-amp's output to ground. \$\endgroup\$ Sep 5, 2019 at 17:54
  • 1
    \$\begingroup\$ In your back-to-back topology you probably want to connect the two N-FETs with the two sources together (swapping D/S for both FETs). This way Vgs will be the same for both FETs. \$\endgroup\$
    – joribama
    Sep 6, 2019 at 6:36
0
\$\begingroup\$

The FET body diode has the Anode on Source which on the OA output causes Vout max = 0.7V while the OA inputs are at 0V in the linear mode of operation.

Your design show T= 1ms with R=1k, C=1uF. You have not given any design specs for integration time and discharge time.

A more practical solution might use a Transmission gate or bipolar Analog Switch with logic level control. Or suitable logic conversion.

Also consider a stable low leakage plastic cap, with a much smaller value like 1nF and R much higher value like 1M if you need 1ms using a much higher impedance or low input bias current OA as you have shown. IF you need high accuracy then choose COG/NP0 ceramic caps that do not have memory or microphonic issues like std ceramic caps.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I thought about mentioning the dielectric absorption issue, but decided against it until the OP gives more information. It is also worth mentioning that input bias current becomes much more significant (and usually outweighs offset voltage) as the input resistance increases. \$\endgroup\$ Sep 5, 2019 at 20:31
  • 1
    \$\begingroup\$ Yes, Ideal integrators need good specs before component selection. Accuracy, range, slew rate, temp range, bias current and then do an error budget to meet spec. Discharge time, residual error, offset error, etc. \$\endgroup\$ Sep 5, 2019 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.