Abstract:
The present invention is a technique for forming a signal representing the operator adjustment of a potentiometer. This technique consists of measuring the reference time constant of the resistance between the fixed terminals of the potentiometer and a capacitor, measuring the variable time constant of the resistance of potentiometer between a fixed terminal and the terminal variable by an operator setting and this same capacitor, and again measuring the reference time constant of the resistance between the fixed terminals of the potentiometer and the capacitor. These time constant measurements are made by discharging the capacitor, charging the capacitor through the appropriate terminal of the potentiometer and measuring the time required for the voltage across the capacitor to reach a predetermined threshold level. This measurement sequence is repeated if the two measures of the reference time constant differ by more than a predetermined amount. The digital ratio of the variable time constant and the reference time constant is then calculated. This digital ratio is the representation of the operator adjustment of said potentiometer.

Description:
FIELD OF THE INVENTION 
     The technical field of this invention is that of detecting the set point of an operator adjustable potentiometer and more particularly the manner of generating a digital reading from the analog input using RC time constant circuits. 
     BACKGROUND OF THE INVENTION 
     Many digital control circuits require operator inputs to specify certain parameters. Often such inputs are provided through the use of a keyboard together with interface circuitry. In other cases it is desirable to enable the input of an analog variable. The input of an analog variable is typically easier for an unsophisticated operator to understand. There have been provided in the prior art potentiometers to enable the input of operator specified analog variables. The operator inputs the desired variable by turning the potentiometer to the position of an accompaning scale. 
     A potentiometer is an electronic component having an electrical resistance which varies with its operator set point. Typically a digital electronic apparatus does not measure the variable resistance of the potentiometer directly. Most typically the variable resistance of the potentiometer is measured by measuring the time constant of an RC circuit in which this variable resistance of the potentiometer is the major contributor to the resistance. This time constant can be measured directly by timing the period needed for the voltage across the capacitor of the RC circuit to charge to a predetermined voltage through the variable resistance of the potentiometer. Alternatively the time constant can be measured indirectly by measuring the frequency of a variable frequency oscillator whose frequency is set by the RC circuit. 
     The measurement of the variable resistance of the potentiometer in this manner is advantageous from a cost stand point. The measurement of the time constant of an RC circuit, either directly or via measurement of the frequency of a variable frequency oscillator, can be performed using simple timing circuits which are adaptable for use with the typical microprocessor employed in such a digital electronic apparatus. By contrast the direct measurement of the variable resistance of the potentiometer would require the use of some sort of analog to digital conversion device which would be more expensive. 
     There are problems with use of such a technique for measurement of the variable resistance of a potentiometer. Firstly, the RC time constant is equally sensitive to any variations in the capacitance. This leads to inaccuracies because the typical inexpensive capacitors employed in these digital electronic apparatuses are neither stable or accurately calibrated. Secondly, the time measured by the RC time constant is also sensitive to the supply voltage. In a typical digital electonic apparatus of this type the power supply regulation is poor. Thus there is a need for an inexpensive technique to obtain an accurate measure of the variable resistance of a potentiometer that is relatively insensitive to variations in capacitance and supply voltage. 
     SUMMARY OF THE INVENTION 
     The present invention enables determination of the resistance of a potentiometer via the measurement of its RC time constant in a manner which is relatively insensitive to changes in capacitance and supply voltage. The measurement is achieved by comparing the time constant of an RC circuit with the variable resistance of the potentiometer as the major source of resistance with the time constant of an RC circuit employing the fixed resistance of the potentiometer. These measurements take place under similar conditions and employing the same capacitor and the same supply voltage. With the time constant of the fixed resistance of the potentiometer as a reference, the variable resistance measurement is made more accurate. 
     In accordance with the preferred embodiment of the present invention time constant measurements are made sequentially for the variable resistance of the potentiometer and the fixed resistance of the potentiometer A capacitor is discharged and then charged via the variable resistance of the potentiometer. The time for the voltage across the capacitor to reach a predetermined voltage is measured. The capacitor is again discharged and charged via the fixed resistance of the potentiometer. The time for the voltage across the capacitor to reach the predetermined voltage is again measured. A ratio is formed of these two measured times. This yields the ratio of the variable resistance of the potentiometer and the fixed resistance of the potentiometer. Since the fixed resistance of the potentiometer is known, the variable resistance of the potentiometer is determined. This ratio is the percentage of the fixed resistance of the potentiometer represented by the set point. 
     Such a two part measurement serves to reduce or eliminate the major sources of inacuracy. Because the same capacitor is employed in both measurements, any inaccuracy in the knowledge of the exact capacitance of this capacitor is removed when the ratio of time constants is formed. It is believed that any changes in the value of the capacitance of the capacitor between consecutive time constant measurements is so small as to not affect the accuracy of the resistance measurement. Similarly, if the two time constant measurements are taken in rapid succession then any inaccuracies due to the poor regulation of the power supply voltage is minimized. 
     The present invention includes an additional refinement which further minimizes any inaccuracy due to change in the supply voltage. The time constant is first measured with the fixed resistance of the potentiometer, then measured with the variable resistance of the potentiometer and lastly again measured with the fixed resistance. The two measurements of the time constant of the fixed resistance of the potentiometer are compared. If they differ my more than a small predetermined amount, then the measurements cannot be confirmed as accurate. In this event the set of measurements is repeated. Any drift in the voltage of the power supply during the sequence of measurements is thus eliminated. 
     The preferred embodiment of the present invention employs a set of tristate outputs from the microprocessor to control the measurement of time constants. Such a tristate output is either the positive or negative supply voltage or substantially isolated from both supply volages. During measurement of a particular time constant one tristate output is employed to charge the capacitor through the selected element and other tristate outputs are set to the isolated state, thereby not contributing to the charge stored within the capacitor. An input having a predetermined voltage trigger is employed to sense the moment when the charge reaches the predetermined level. The microprocessor is programmed to provide the entire measurement sequence, measure the time required to charge the capacitor to the specified voltage and forms the ratio via its computational capabilities. In the preferred embodiment the measurement of the time occurs by a program incrementing a memory registor in a closed loop, which is stopped when the voltage on the capacitor triggers a interrupt input. This technique minimizes the necessary components external to the microprocessor. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other aspects of the present invention will become clear from study of the drawings in which: 
     FIG. 1 illustrates an example of an electronic thermostat employing a microprocessor in accordance with the prior art; 
     FIG. 2 illustrates connections to the microprocessor for reading the temperature indicated by a thermistor and a set point set by a potentiometer; 
     FIGS. 3a and 3b illustrate a program for a simple electronic set point thermistor employing the circuitry illustrated in FIG. 2; and 
     FIG. 4 illustrates an example of the subroutine for measuring the time constant of an RC circuit connected in the manner illustrated in FIG. 2. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     The present invention will be described in conjunction with a description of a digital electronic thermostat. Such a digital electronic thermostat is the type of digital electronic apparatus that would employ the potentiometer reading technique of the present invention. 
     FIG. 1 illustrates the typical construction of an electronic programmable thermostat in accordance with the prior art. Electronic programmable thermostat 100 includes microprocessor unit 110 which is coupled to display 113 and keyboard 115, power supply regulator 120, a buffer 125 which drives a triac 133, a series resistor 131, a heat/cool mode switch 135 and a temperature sensing circuit including variable resistor 141, thermistor 142, capacitor 143 and transistor 144. Electronic thermostat 100 is connected to a combined heating and air conditioning plant including AC power supply 10, heating unit 20 with an associated relay 25 and air conditioner 30 with associated relay 35. 
     Electronic thermostat 100 is programmed via keyboard 115 to store a sequence of desired temperatures at desired times. The ambient temperature of the thermostat is measured via thermistor 142. The resistance of thermistor 142 is measured by measuring the time constant of the RC circuit including variable resistor 141, thermistor 142 and capacitor 143. In accordance with the relationship with the measured temperature to the desired temperature, microprocessor unit 110 generates an output at output 1 to buffer 125 which controls whether triac 133 is triggered ON or not. If triac 133 is triggered ON then one of the relays 25 or 35 is supplied with electric power from AC source 10 depending upon the state of heat/cool mode switch 135. The actuated relay in turn operates the corresponding heating unit 20 or air conditioner 30. 
     Power supply regulator 120 is connected to receive power from the series connection of resistor 131 and triac 133. This power comes from AC power source 10. In the event that triac 133 is not triggered ON, then the full voltage of the AC power source 10 appears across the input to power supply regulator 120. If, on the other hand, triac 133 is triggered ON, then the voltage input to power supply regulator 120 is the voltage across triac 133 together with the IR voltage appearing across resistor 131. As a result, the input voltage applied to power supply regulator 120 varies widely depending on whether or not triac 133 is triggered ON. Therefore, power supply regulator 120 is employed to smooth these wide variations in supply voltage to derive the appropriate voltage for driving the microprocessor unit 110. 
     The ambient temperature is measured by the microprocessor unit 110 from the variable resistor 141, thermistor 142, capacitor 143 and transistor 144. Variable resistor 141 and thermistor 142 together with capacitor 143 form a RC time constant circuit. The resistance of thermistor 142 varies as a function of ambient temperature. This resistance is measured by measuring the time constant of this RC circuit. Microprocessor unit 110 includes a plurality of tristate output lines 0--3. One of these tristate output lines is applied to one end of the RC time constant circuit, while the other end of this RC time constant circuit is connected to ground. 
     These tristate output lines of microprocessor unit 110 have unique characteristics. The output of each of these tristate output lines can be driven to the power supply voltage in response to a &#34;1&#34; output or to the ground voltage in response to a &#34;0&#34; output. In this state the output line is connected through a relatively small resistance of 50 to 100 ohms to the respective voltage source. It is also possible to drive any of these tristate output lines to an indeterminate state in which the output line is connected to neither the positive supply voltage or ground. Typically, the isolation between the output and either the power supply voltage or ground is greater than 5 megaohms when in the indeterminate state. 
     Transistor 144 is connected across capacitor 143. Transistor 144 has its base connected to output 2 of the microprocessor unit 110. Transistor 144 is employed to discharge any charge which is stored on capacitor 143. In response to a &#34;1&#34; output on output 2 from microprocessor unit 110, transistor 144 is biased ON and discharges any charge stored in capacitor 143. In response to a &#34;0&#34; output at output 2 of microprocessor unit 110, transistor 144 is biased OFF and does not effect the charge on capacitor 143. 
     Lastly, the output voltage across capacitor 143 is connected to an interrupt input of microprocessor unit 110. This interrupt input includes a Schmidt trigger device which rapidly turns on when a predetermined voltage is reached at this input. This interrupt input is employed to signal microprocessor unit 110 that the voltage across capacitor 143 has exceeded this predetermined value. 
     During operation of electronic thermostat 100, the temperature indicated by thermistor 142 is measured employing a program stored within microprocessor unit 110 to control the output supplied to this measurement circuit. Firstly, transistor 144 is biased ON in order to discharge any charge stored in capacitor 143. During this operation the tristate output 0 could be held at either the indeterminate state or at ground through the output of a digital &#34;0&#34;. After transistor 144 had been biased ON for a sufficient period to substantially discharge capacitor 143, output 2 supplied to the base of transistor 144 is changed to bias this transistor to OFF. 
     The time constant of the RC circuit is then measured. The tristate output line 0 is driven to the power supply voltage via the output of a digital &#34;1&#34;. At the same time a timer circuit is initialized and begins to accumulate the elapsed time. This output from the tristate output line 0 causes the power supply voltage to be applied across variable resistor 141, thermistor 142 and capacitor 143. As a consequence, a current flows through this RC circuit and begins accumulate charge within capacitor 143. This accumulating charge within capacitor 143 causes the voltage thereacross to increase. This voltage is sensed by the interrupt input INT of microprocessor unit 110. When the voltage across capacitor 143 exceeds the predetermined threshold of interrupt input INT, this input is triggered. Microprocessor unit 110 is programmed to stop the elapsed time clock at this time. As a consequence, the time then indicated by the elapsed time clock is a measure of the time constant of the RC circuit. Ideally, the only variable in this time constant measurement is the resistance of thermistor 142. Therefore, this measured elapsed time is a measure of the temperature sensed by thermistor 142. Typically, microprocessor unit 110 includes a look-up table to convert this time to the corresponding temperature. 
     There are several disadvantages with the foregoing manner for sensing the temperature. Typically, the resistance of the thermistor is not the only variable in the system. In particular, the capacitance of capacitor 143 may change slowly with time. In addition, the exact temperature/resistance curve of thermistor 142 and the exact capacitance of capacitor 143 are not typically well defined. For this reason, variable resistor 141 has been included in the RC time constant circuit in order to adjust for these factors. Variable resistor 141 may be eliminated if a high precision thermistor 142 and a high precision capacitor 143 are employed. However, the magnitude of the supply voltage is an additional variable. As explained above, the supply voltage applied to microprocessor unit 110 is typically not very well regulated. Therefore, the voltage used to charge capacitor 143 through variable resistor 141 and thermistor 142 can vary depending upon the state of triac 133. This variation in supply voltage causes a variation in the time required to charge capacitor 143 to the predetermined voltage. These variations in the supply voltage can cause inaccuracies in the measured temperature. 
     As a result of these factors, the designer in accordance with the prior art could make one of two relatively disadvantageous choices. Firstly, a highly complex power supply regulator 120 which provides an excellent regulation of the power supply to microprocessor unit 110 could be employed together with a high precision thermistor 142 and a high precision capacitor 143. A design of this type would serve to eliminate many of the sources of inaccuracy in the measurement of a temperature in accordance with the above described circuit. This provision for a highly accurate power supply regulator 120 and precision components would require additional expense in the construction of the electronic thermostat. On the other hand, a relatively low accuracy power supply regulator 120 could be employed with relatively inexpensive but less precise components. This design technique reduces the cost of electronic thermostat 110 with a consequent decrease in the accuracy of the temperature measurement and thus the accuracy of the control of temperature. 
     FIG. 2 illustrates a circuit similar to the circuit illustrated in FIG. 1 for measuring the resistance of a thermistor 211. FIG. 2 illustrates a RC time circuit including a plurality of resistances and a single capacitance, capacitor 220. Thermistor 211 is connected between the tristate output line 0 of microprocessor device 110 and capacitor 220. Similarly, a high precision fixed resistor 213 is connected between tristate output line 1 and the capacitor. Further, a potentiometer 215 has its fixed resistance connected between tristate output line 2 and the capacitor and its variable resistance connected between tristate output line 3 and the capacitor. Although a discharge circuit such as transistor 144 is not illustrated in FIG. 2, it would be understood by those skilled in the art that such a discharge circuit could be employed. 
     The object of the invention illustrated in FIG. 2 is to increase the accuracy of temperature measurement while reducing the need for precision components. Precision fixed resistor 213 is the only precision component required in this circuit. In addition, a power supply regulator 120 having relatively poor regulation can be employed with this circuit. The use of precision fixed resistor 213 as the single precision component reduces the cost of construction because precision fixed resistors are much less expensive than precision thermistors or precision fixed capacitors. 
     Measurement of the resistance of thermistor 211 occurs in a manner similar to that described above in conjunction with the description of FIG. 1. Capacitor 220 is discharged. This could occur through a discharge device such as transistor 144 illustrated in FIG. 1. Because a discharge transistor such as transistor 144 has a very low impedance very little time would be required to discharge capacitor 220 using such a device. Alternatively this discharge could occur by tying all of the tristate output lines 0-3 to the ground potential by applying a &#34;0&#34; output to these lines. This latter technique is believed advantageous because it reduces the need for components external to the microprocessor unit 110. Because such a discharge path would involve a much higher impedance than a discharge transistor, care must be taken to maintain this discharge condition for a sufficiently long time. This period of time should be at least seven times the time constant of the combined discharge path and capacitor 220. Once the capacitor 220 has been sufficiently discharged, an indeterminate high impedance output is applied to tristate output lines 1-3. At the same time, a &#34;1&#34; output is applied to tristate output line 0. At the same time an elapsed timer is started in a manner similar to that described above. When the voltage across capacitor 220 reaches the predetermined threshold voltage of the interrupt input INT of microprocessor unit 110, then the elapsed time on the elapsed time counter corresponds to the resistance of thermistor 211. This in turn corresponds to the temperature at thermistor 211. 
     After this measurement has been made then a second measurement is made. Firstly, capacitor 220 is discharged in a manner similar to that described above. Then capacitor 220 is charged via precision fixed resistor 213. This is achieved by applying an indeterminate high impedance output to tristate output lines 0, 2 and 3 and by applying a digital &#34;1&#34; output to tristate line 1. This applies the power supply voltage across the RC circuit including precision fixed resistor 213 and capacitor 220. In the same manner as previously described, the elapsed time is measured from the first application of voltage across capacitor 220 until the voltage across capacitor 220 exceeds the predetermined threshold of the interrupt input INT. This elapsed time is a measure of the resistance of precision fixed resistor 213. 
     In accordance with the preferred embodiment, the resistance selected for the precision fixed resistor 213 is approximately equal to the nominal value of the resistance of thermistor 211 at a selected reference temperature, such as 70° F. The arithmetic computational capability of the microprocessor 110 is then used to compute the ratio of the time constant measured through thermistor 211 and the time constant measured through precision resistor 213. This ratio of times gives an indication of the ratio of the resistance of thermistor 211 to the resistance of precision fixed resistor 213. The computation of this ratio has the advantageous effect of eliminating sources of variability. The value of capacitance 220 is the same for each measurement. In addition, if these time constant measurements take place sequentially, the power supply voltage of microprocessor 110 cannot change greatly during this interval. Thus the formation of this ratio serves to eliminate many of the sources of inaccuracy of the measurement of the resistance of thermistor 211. This serves to permit a more precise measure of the temperature. 
     FIG. 2 also illustrates connections for determining the operator set position of a potentiometer. This technique employs a ratio in the manner similar to that described above in conjunction with measuring the resistance of thermistor 211. First, capacitor 220 is discharged. Then capacitor 220 is charged through the fixed value of potentiometer 215. This is accomplished by driving the tristate output line 2 to a digital &#34;1&#34; while leaving the other tristate output lines at the indeterminate high impedance state. Thus capacitor 220 is charged through the fixed resistance of potentiometer 215. The time necessary for the voltage across capacitor 220 to reach the predetermined threshold of the interrupt input is measured. Next, capacitor 220 is again discharged. Capacitor 220 is then charged through the variable portion of potentiometer 215. This is accomplished by setting the output of tristate output line 3 to a digital &#34;1&#34;, thereby applying the power supply voltage to the variable wiper contact of the potentiometer. At the same time, the other tristate output lines are set to the high impedance state. Thus capacitor 220 is charged only through the variable wiper of potentiometer 215. Again, the amount of time for the voltage across capacitor 220 to reach the predetermined value of the interrupt input is measured. The output or set point of potentiometer 215 is determined by forming the ratio of the charge time through the wiper input to the charge time through the fixed resistance. As in the case of the measurement of the resistance of thermistor 211 described above, the taking of this ratio serves to reduce the measurement error due to variable parameters. In the case of the measurement of the set point of the potentiometer, the same capacitor 220 is employed, thereby eliminating any variability in the nominal value of the capacitor. In addition, if these time and measurements are taken sequentially, any variation in the power supply voltage is minimized because the change in power supply voltage over such a short period is small. 
     FIGS. 3a and 3b illustrate the flow chart of a program for microprocessor unit 110. This program for microprocessor unit 110 causes electronic thermostat 100 to be a simple manual set point thermostat. The manual set point is set by the position of potentiometer 215. 
     FIGS. 3a and 3b illustrate program 300 in flow chart form. Program 300 is a continuous loop which is continuously executed in order to provide thermostatic control of the selected heating unit or air conditioner. The discussion of program 300 (see FIG. 3a) will begin with processing block 301. Processing block 301 measures the time constant of the RC circuit including precision fixed resistor 213 and capacitor 220. The manner of performing this time measurement has been explained above, and will be further explained in regard to subroutine 400. Program 300 next measures the time constant of the RC circuit including thermistor 211 (processing block 302). This time measurement takes place in a similar fashion. Next, program 300 again measures the time constant of the RC circuit including precision fixed resistor 213 (processing block 303). This second measurement through precision fixed register 213 is employed to further minimize any effect due to the changing power supply voltage. 
     Program 300 tests to determine whether the two time constant measurements of the precision fixed resistor 213 are within a predetermined error limit E (decision block 304). This is determined by taking the absolute value of the difference between the first time constant value t Rl  and the second time constant value t R2 . These two measurements are within the error limit E if this absolute value is less than E. If the two measurements are not within this error limit E then program control passes to processing block 301 to measure the time constant of the precision fixed resistor 213 again. Program 300 remains within this loop until the two time constant measurements are within the predetermined error limit E. This process assures that the measurement conditions have not appreciably changed during the period when the three time constant measurements are taken. 
     Once the measurements regarding the thermistor time constant have been completed, Program 300 forms the ratio of the thermistor time constant to the precision fixed resistor time constant by the formula: 
     
         t.sub.TC =t.sub.T /t.sub.Rl 
    
     where t TC  is the corrected time constant of the thermistor, t T  is the uncorrected time constant of the thermistor, and t Rl  is the first measured time constant of the reference resistor (processing block 305). This ratio is next employed with a look-up table in order to derive the measured ambient temperature T A  (processing block 306). 
     Program 300 (FIG. 3b) next measures the set point of potentiometer 215. This is accomplished by measuring the time constant of the fixed portion of potentiometer 215 (processing block 307). This is followed by the measurement of the time constant through the potentiometer tap (processing block 308). Lastly, a second measurement of the time constant through the entire fixed portion of the potentiometer is made (processing block 309). 
     Program 300 then makes a test similar to that indicated above in relation to the measurement of the time constant of the thermistor. Program 300 tests to determine if the absolute value of the difference between the first measured time constant of the potentiometer t Pl  and the second measured time constant of the potentiometer t P2  is less than a predetermined error limit E (decision block 310). If it is not, then the measurement process is repeated. As previously described Program 300 remains in this loop until the measurement is complete. Program 300 proceeds to processing block 311 when the difference is less than the error limit E. 
     A ratio is then formed in the microprocessor of the time constant measured (processing block 311). This ratio is similar to the ratio previously described for determination of the temperature measured by the thermistor. This ratio is calculated as follows: 
     
         t.sub.S =t.sub.TP /t.sub.Pl 
    
     where t S  is the corrected set point measured by the potentiometer tap, t TP  is the uncorrected time constant through the potentiometer tap, and t Pl  is the first measurement of the time constant through the fixed portion of the potentiometer. Program 300 then resorts to a look-up table to convert this ratio to the set point temperature T S  (decision block 312). 
     Program 300 then performs the thermostatic control. This is shown embodied by an illustrative subroutine 320. Subroutine 320 is a simple example of thermostatic control employing the sensing circuits of the present invention. Those skilled in the art would recognize that the sensing circuits of the present invention could be employed with other thermostatic control processes. 
     Subroutine 320 of program 300 determines whether or not the electronic thermostat 100 is in heating mode (decision block 321). This heating mode is set via keyboard 115 in conjunction with the position of heat/cool mode switch 135 to determine the particular algorithm employed. If the electronic thermostat 100 is in heating mode then program 300 tests to determine whether or not the ambient temperature is less than the set point temperature (decision block 322). If this is the case then the triac 133 is triggered on (processing block 323) in order to activate heating unit 20 and raise the temperature. On the other hand, if the ambient temperature is not less than the set point then triac 133 is not triggered ON (processing block 324). In this event it is not necessary to operate heating unit 20 to raise the temperature above the set point temperature. 
     If the electronic thermostat 100 is not in the heating mode then program 300 tests to determine whether or not the ambient temperature is greater than the set point temperature (decision block 325). In the event that the ambient temperature is greater than the set point temperature then triac 133 is triggered ON (decision block 323). In conjunction with the position of heat/cool mode switch 135, this serves to turn on air conditioner 30 to lower the temperature. If the ambient temperature is not greater than the set point temperature then program 300 does not trigger triac 133 ON (processing block 324). Thus air conditioner 30 is not actuated because it is not needed. 
     Program 400 illustrated in FIG. 4 is a flow chart of the manner in which the time constants are measured in program 300. Subroutine 400 is employed to embody processing blocks 301, 302, 303, 307, 308 and 309 illustrated in FIGS. 3a and 3b. Subroutine 400 is begun at start block 401. Subroutine 400 first discharges capacitor 220 (processing block 402). This could take place with the use of an external device such as transistor 144 illustrated in FIG. 1 or via the tristate output lines 0-3. Next, an index variable i is initialized (processing block 403). The capacitor 220 is then charged via the particular element J (processing block 404) by actuation of the proper tristate output line 0-3. Subroutine 400 then increments the index variable i (processing block 405). Next, subroutine 400 tests to determine whether or not the voltage across capacitor 220 V C  is greater than or equal to the threshold voltage (decision block 406). If this is not the case then the measurement is not complete and subroutine 400 returns to processing block 405. If this is the case then the measurement is complete. The measured time for the element J t J  is set equal to the index variable i (processing block 407). Subroutine 400 is then complete and is exited via end block 408. 
     In a practical embodiment of subroutine 400, the incrementing step 405 would be performed by adding 1 to a memory register within microprocessor unit 110. The processing of determining whether or not the voltage across the capacitor V C  exceeds the predetermined threshold of decision block 406 can be employed via the interrupt input INT of microprocessor device 110. Thus for example the incrementing of the index variable i can occur within a closed loop and this loop be broken only at the receipt of the interrupt. The interrupt is detected when the voltage across the capacitor exceeds the predetermined threshold of the interrupt input INT. Because this interrupt input INT typically includes a Schmidt trigger device, there is very little time between the time at which the voltage crosses the threshold voltage and the generation of the interrupt. This interrupt signal stops the incrementing of the index variable i and causes this value to be stored as the measured time. Thus the clock which controls the rate of operation of the microprocessor device 110 serves as a timer to time the number of increments of the index variable i.