Track-and-hold peak detector circuits having a capacitor to hold a voltage corresponding to an input signal are known. In conventional track-and-hold peak detector circuits, or more simply, peak detector circuits, it is known that the voltage on the capacitor tends to drift with time due to leakage currents in the capacitor itself and also due to leakage currents in circuitry surrounding the capacitor.
Conventional proximity sensors are also known, which can detect, for example, peaks and/or thresholds associated with an output signal generated by one or more magnetic field sensors in response to presence or absence of a ferrous object, for example, a tooth of a ferrous gear, or in response to presence or absence of a magnet. Within the proximity sensor, the conventional peak detector circuit can be used, to reduce the effect of a DC offset in an output signal provided by one or more magnetic field sensors, e.g., Hall effect sensors. With this arrangement, the peak detector circuit can allow the Hall effect sensors to more accurately detect peaks (and/or thresholds) associated with an AC portion of a signal generated by the Hall effect sensors in response to the passing gear teeth.
In some applications, for example, automobile applications, a proximity sensor and associated peak detector circuit may be required to operate at low input signal frequencies (e.g., one Hz) and high temperatures (e.g., 150 C.). As is known, high temperatures tend to result in relatively high leakage currents, and therefore, a relatively high voltage drift in a voltage held on a capacitor used in the peak detector circuit.
A conventional peak detector circuit, particularly when operating with a low input signal frequency, requires a capacitor with a large capacitance value (typically about 0.1 uf at 10 Hz) in order to accurately hold a voltage in the presence of the leakage currents. As is known, large capacitors are not readily integrated onto a common substrate with other circuitry. Therefore, the conventional peak detector circuit often requires use of an external capacitor. Use of the external capacitor increases sensitivity of the peak detector circuit to electrical noise from external noise sources, which can degrade accuracy and repeatability of the peak detector circuit. The external capacitor also tends to be undesirably large and can also be costly.
Referring now to FIG. 1, a conventional peak detector circuit 10 includes a capacitor 20 having a threshold node 20a. The conventional peak detector circuit 10 also includes a charging circuit 14 having a charging circuit input node 14a to receive an input signal 12 and a charging circuit output node 14b coupled to the threshold node 20a. The conventional peak detector circuit 10 still further includes a comparator 24 having a first comparator input node 24a coupled to the threshold node 20a, a second comparator input node 24b coupled to the charging circuit input node 14a, and a comparator output node 24c. 
In operation, the charging circuit 14 provides a charging signal at the charging circuit output node 14b to charge the capacitor 20 to a voltage in accordance the input signal 12. For example, as the input signal 12 rises in voltage, the voltage at the charging circuit output node 14b rises accordingly, charging the capacitor 20 to a voltage according to the input voltage 12. However, because the charging circuit 14 is unable to discharge the capacitor 20, as the input signal 12 falls in voltage, the voltage at the capacitor 20 holds the last highest voltage of the input signal.
The comparator 24 provides a comparator output signal 26 at the comparator output node 24c in response to a voltage difference, Vc−Vi, between the voltage, Vc, at the threshold node 20a and the voltage, Vi, of the input signal 12. The comparator 24 can be arranged having two thresholds to provide hysteresis. As described above, the capacitor 20 holds the peak voltage of the input signal 12 at the threshold node 20a. When the input signal 12 thereafter begins to transition to a lower voltage, crossing an upper comparator threshold (as Vc−Vi increases), a change in state occurs at the comparator output node 24c. The change in state at the comparator output node 24c can be used to detect a peak of the input signal 12.
As described above, a voltage held on the capacitor 20 tends to drift. It will be understood that the voltage drift on the capacitor 20 is generally in a positive direction due to a leakage current 19 through the transistor 18. Therefore, an input signal 12 having a constant or decreasing voltage in combination with an increasing voltage at the holding capacitor 20 due to voltage drift can results in a false change in state at the comparator output node 24c (also referred to here as a self-switching). Furthermore, an input signal having a decreasing voltage in combination with a decreasing voltage at the holding capacitor 20 for example, in the presence of a negative voltage drift, can result in a change in state that is delayed in relation to that which would occur with no voltage drift.
The above-described self-switching is discussed in U.S. Pat. No. 5,442,283, issued Aug. 15, 1995, entitled “Hall-Voltage Slope-Activated Sensor,” which is assigned to the assignee of the present invention. The described sensor uses a dual-polarity peak detector. However, the dual-polarity peak detector is also subject to self-switching.
In order to reduce or avoid self-switching, a compensation circuit 28 can provide a compensation current 27 at the threshold node 20a in opposition to the leakage current 19 through the transistor 18, reducing the voltage drift on the capacitor 20. However, because the leakage current 19 through the transistor 18 is only approximately known, and is also known to vary with temperature as described above, the applied compensation current 27 does not exactly compensate for the leakage current 19 at all temperatures.
The compensation circuit 28 can reduce a peak detection accuracy of the peak detector circuit 10. For example, a compensating current 27 that is too high (i.e., over compensated) produces an undesired voltage drift in the opposite direction (negative direction) during a holding time (i.e., the transistor 18 is off), and tends to reduce a detection accuracy of the peak of the input signal 12.
Furthermore, the compensation current 27 can affect a minimum operating frequency of the peak detector circuit 10. For example, after a positive peak of the input signal 12 has passed, if a negative rate of change of the input signal 12 signal is less than or equal to the overcompensated voltage drift (also in the negative direction), then a peak in the input signal 12 will not be detected at all.. A negative rate of change of the overcompensated capacitor voltage is related to the minimum operating frequency of the peak detector
Use of the compensation circuit 28 to provide the compensation current 27 opposing the leakage current 19 through the transistor 18 results in a trade-off between self-switching reduction and the minimum operating frequency at which the peak detector circuit 10 can operate properly. The larger the required compensation current 27 used to avoid self switching, the larger the potential overcompensation and the higher the minimum operating frequency become.
From the above discussion, it should be apparent that prior art peak detector arrangements used to reduce self-switching are not suitable for low-frequency high-temperature operation. Furthermore, having an external holding capacitor, prior art peak detectors tend to be relatively large.