Circuit for shaping a measurement-signal voltage into a square-wave signal
BACKGROUND OF THE INVENTION 
     The present invention relates to a circuit for shaping a measurement-signal voltage into a square-wave signal. 
     A circuit of this kind is described in the journal &#34;Elektronik&#34;, No. 10, May 17, 1985, p. 100. There an operational amplifier connected as a Schmitt trigger is used for shaping a measurement signal into a square-wave signal. The amplified measurement signal is applied to the positive input of the operational amplifier, and the supply voltage to the other, negative input. The supply voltage is assumed to be constant, so that a stabilized supply voltage must be present. Errors in the measurement signal are corrected by means of a voltage divider which includes a positive temperature coefficient resistor; that is, a resistor whose resistance increases with an increase in its temperature, and has its tap connected to one of the inputs of an operational amplifier. This gives a temperature-controlled current source for a sensor whose measurement-signal voltage is to be shaped. For temperature compensation, resistors which are not otherwise necessary are connected into the leads to the inputs of an operational amplifier. 
     SUMMARY OF THE INVENTION 
     It is the object of the present invention to obtain an error-corrected square-wave output voltage with little circuitry and with components of minimum size. 
     This object is attained by a circuit which eliminates the need for a stabilized supply voltage and special temperature control. 
     This object and others to become apparent as the specification progresses, are accomplished by the invention, according to which briefly stated is a circuit for shaping a measurement-signal voltage obtained from a voltage divider containing a DC component and an AC component into a square-wave signal. The voltage divider has a low end which is grounded through a load resistor. The load resistor is shunted by a series combination of a resistor and a grounded capacitor. The low end is connected through the resistor to a negative input of a comparator and through an additional resistor to the positive input of the comparator. The positive input is also connected through a feedback resistor to the output of the comparator. Additionally, the low end is connected to the supply voltage through a second voltage divider. The second voltage divider has a controllable, temperature-stabilized zener diode which forms a first resistor. The diode is connected through a second resistor of the second voltage divider to the supply voltage and has a control electrode which is subjected to the measurement-signal voltage obtained from the tap of the first voltage divider. 
     Further advantageous details of the invention are set forth in the preferred embodiment of the invention which will now be described with reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows a circuit with an RC section connected to the first voltage divider; 
     FIG. 2 shows how magnetoresistors are positioned relative to the teeth of a gear or rack, and 
     FIG. 3 shows a graph of an amplified measurement signal and a square-wave signal derived therefrom. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The reference numeral 1 denotes a voltage divider consisting of two magnetoresistors 2 and 3. If the teeth of a gear or rack are spaced at regular intervals, the magnetoresistors 2 and 3 are displaced in relation to one another by a quarter of the tooth pitch, as shown in FIG. 2. The voltage divider 1 may also consist of only one magnetoresistor and a normal resistor. It gets its operating voltage U B  from a supply voltage U V  via a dropping resistor 4. 
     Connected in parallel with the voltage divider 1 is a controllable impedance 5, preferably a controllable zener diode, such as the IC type TL 431, or, as shown beside FIG. 1, a zener diode 5.1 in series with the emitter-collector path of a transistor 5.2. This controllable impedance 5 and the dropping resistor 4 form a second voltage divider 6. The tap 7 of the first voltage divider 1 is connected to the control input 8 of the controllable impedance 5. Also connected in parallel with the first voltage divider 1 is a capacitor 9, and a resistor 11 is interposed between the high end 10 of the voltage divider 1 and the tap 12 of the second voltage divider 6. The resistor 11 and the capacitor 9 form a timing section whose time constant is longer than the longest period of the AC voltage component U W  at the tap 7 of the voltage divider 1, preferably 5 to 20 times as long. 
     If the integrated controllable impedance is of the aforementioned type TL 431, any changes in the values of the circuit, such as temperature changes or aging, and thus changes in the resistances of the magnetoresistors 2 and 3 or the other circuit components will be compensated for because this integrated circuit incorporates internal temperature compensation. Therefore, the output signal is highly stable. 
     To keep the size and, hence, the values of the circuit components small, the drain-source path of a field-effect transistor 14 is connected from the high end 10 of the first voltage divider 1 to the high end 13 of the dropping resistor 4 and, thus, to the supply voltage U V , and the junction 15 of the capacitor 9 and the resistor 11 is connected to the gate 16 of the field-effect transistor 14 and, thus, via the very high-impedance gate-source path to the high end 10. The field-effect transistor 14 acts as an impedance-matching transformer and holds the high end 10 at a constant potential. Because of the very high input resistance of the field-effect transistor 14, only very small currents on the order of, e.g., a few picoamperes will flow in the gate-source path. The capacitor 9 can thus be made very small. In a practical embodiment, the value of the resistor 11 was of the order of about 10 megohms to a few 10 megohms, and the value of the capacitor 9 was of the order of 100 nF. 
     The circuit can be built with few small-size components, so that it can be combined into a structural unit and housed in a single package which is provided with only two leads. The components 18 to 26 are contained in a second unit, which can be easily mounted wherever required. 
     The operation of the circuit is as follows. 
     A ferromagnetic gear or rack Z, which may be magnetized, is moving relative to the two magnetoresistors 2, 3. If the gear or rack is not magnetized, the magnetoresistors have a permanent magnet associated therewith in a manner known per se. The magnetic field of the permanent magnet passes through the magnetoresistors, and its direction in the magnetoresistors is changed by the external ferromagnetic part, thereby changing the resistances of the magnetoresistors. As the teeth of the gear Z move past the magnetoresistors 2, 3, which are displaced in relation to one another by a quarter of the tooth pitch, the resistance value of one magnetoresistor, e.g., 2, increases, and that of the other, 3, decreases, periodically, and vice versa, from the same standard value. Thus, a measurement signal U M  consisting of a DC component U G  and an alternating component U W  superimposed thereon is obtained at the tap 7. The measurement signal U M  controls the impedance 5 in such a way that the voltage at the tap 12 increases as the voltage at the tap 7 decreases. Without the capacitor 9 and the resistor 11, this would necessitate increasing the operating voltage U B  across the first voltage divider 1 until the voltage at the tap 7 equals the reference voltage at the control input of the controllable impedance 5. In the case of the IC type TL 431, this reference voltage is 2.5 V. 
     Because of the long time constant of the RC section 9, 11 in connection with the high-impedance gate-source path of the field-effect transistor 14, the change in the value of the impedance 5 has no effect at the first voltage divider 1, i.e., no control takes place. The change in the impedance of the second voltage divider 6 causes a change in the current flowing through this voltage divider, so that the measurement signal U M  is amplified. 
     A load resistor 18 is connected from the low end 17 of the first voltage divider 1, which is coupled to the anode of the controllable zener diode 5, to ground. This load resistor 18 can be attached at any external point if the aforementioned circuit is combined to form a structural unit. The circuit therefore has only two input leads, namely the lead connecting the load resistor 18 to the low end 17 and the lead for the supply voltage U V . 
     To change the amplified measurement signal U M  &#39; obtainable from the low end 17 into a square-wave output voltage U A , the low end 17 is connected via a resistor 19 to the negative input 20 of an operational amplifier 21 used as a comparator, and the input 20 is grounded through a capacitor 22. Thus, the DC component U B  &#39; appears across this capacitor. The low end 17 is also connected through a resistor 23 to the positive input 24 of the operational amplifier 21. Connected between the positive input 24 and the output 25 of the operational amplifier 21 is a feedback resistor 26. The threshold voltages of the operational amplifier 21, which is used as a comparator, and thus the hysteresis H are determined by the values chosen for the resistors 23 and 26, so that by comparing the amplified measurement-signal voltage U M  &#39; with the DC component U G  &#39;, a temperature-stabilized square-wave voltage U W  &#34; is obtained as the output voltage U A  at the output 25 of the operational amplifier 21. 
     To achieve a highly stable square-wave output signal U A , only two separately mountable circuit modules 27 and 28 with few, small-size components are thus necessary, one for generating the amplified measurement-signal voltage U M  &#39; and one for generating the square-wave voltage U A .