Metering circuit including a floating count window to determine a count

A method includes receiving a count corresponding to a number of peaks of a resonant signal that exceed a reference signal and comparing the count to a floating count window defined by a first count threshold and a second count threshold, the first count threshold is larger than the second count threshold. The method further includes selectively shifting the floating count window in a direction of the count when the count falls outside of the floating count window.

FIELD

The present disclosure is generally related to metering circuits, such as circuits configured to count signal peaks from a ringing signal to determine usage of a utility, for example.

BACKGROUND

Water and gas meters use a variety of measuring and sensing techniques. One method of sensing position and rotation of a metering apparatus uses inductor-capacitor (LC) sensing, which employs an LC resonant circuit. An LC meter interface may stimulate the LC resonant circuit and measure the response (a ringing waveform).

SUMMARY

In an embodiment, a method includes receiving a count corresponding to a number of peaks of a resonant signal that exceed a reference signal and comparing the count to a floating count window defined by a first count threshold and a second count threshold, the first count threshold is larger than the second count threshold. The method further includes selectively shifting the floating count window in a direction of the count when the count falls outside of the floating count window.

In another embodiment, a metering circuit includes a first comparator including an input to receive a resonant signal, a second input to receive a reference signal, and an output. The metering circuit further includes a counter including an input coupled to the output and including an output to provide a count corresponding to a number of peaks of the resonant signal that exceed the reference signal. The metering circuit also includes a second comparator to compare the count to a floating count window defined by a first count threshold and a second count threshold and a controller coupled to an output of the comparator and configured to selectively shift the floating count window in a direction of the count.

In still another embodiment, an apparatus includes a first comparator having a first input to receive an input signal, a second input to receive a reference signal, and an output. The apparatus further includes a counter having an input coupled to the output of the first comparator, and includes an output to provide a count. The apparatus also includes a count discriminator circuit to compare the count from the counter to a floating count window and to shift the floating count window to match the count when the count falls outside of the floating count window.

In the following discussion, the same reference numbers are used in the various embodiments to indicate the same or similar elements.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

Metering circuits often use a threshold to compare against an input signal to decide whether a condition is met. However, changes in temperature and voltage may change the input signal and/or the threshold. Instead of performing calibrations to adjust the threshold for such changes, embodiments of a metering circuit are described below that use a floating count window to track changes in the detection of the input signal. In particular, embodiments of the metering circuit utilize a count window having a pre-defined size that is smaller than a difference between an upper count corresponding to a first state of a system and a lower count corresponding to a second state of the system. By sizing the count window to be smaller than such a difference, changes in the count will move the window up or down, which directional changes can be represented by a change in a state of the output signal, representing a change in state of the system. An embodiment of such a metering circuit is described below with respect toFIG. 1.

FIG. 1is a block diagram of a system100including a metering circuit104employing a floating count window to determine a count according to an embodiment. The system100includes a wheel102that rotates in response to flow of a consumable element, such as electricity, water, gas, or other measurable substance. The wheel102includes a metallized portion (represented by the hash marks) and a non-metallized portion.

The system100further includes a resonant tank103. The resonant tank103includes an inductor106in parallel with a capacitor108, which are coupled between a node110and a power supply, such as ground. The node110may be coupled to the metering circuit104through a capacitor112.

The metering circuit104includes an input114(such as a pad) that is coupled to the capacitor112and to a positive input of a comparator116. The comparator116includes a negative input coupled to a digital-to-analog converter (DAC)118, which operates as a programmable reference to supply a reference voltage to the comparator116. The comparator116also includes an output to provide pulses representing peaks in the input waveform to a counter120. The counter120provides a count signal, representing the number of peaks of the input waveform that exceed the threshold signal provided by the DAC118, to an input of a comparator126of a count discriminator circuit122. The comparator126includes a second input to receive threshold signals corresponding to a floating count window124, and includes an output to provide an output signal128to an input of a controller, such as a finite state machine (FSM)130. The FSM130may update count registers132and134and may be coupled to a microcontroller unit (MCU)136.

In an embodiment, the metering circuit104may be used to detect peaks in a resonant signal from the LC tank circuit103. The LC tank circuit103may be energized, and the energy resonates back and forth between the capacitor108and the inductor106while decaying due to inductor resistance and magnetic flux loss, producing a ringing waveform at the input114of the metering circuit104. The duration of the decaying sine wave (ringing waveform) can be determined by counting the number of peaks of the ringing waveform. When a metalized section of the wheel102is proximate to the inductor106of the LC tank circuit103, some of the magnetic flux will be absorbed by the metal, causing the sine wave to decay faster and reducing the number of peaks (counts), i.e., damping the input signal.

The comparator116receives the ringing waveform at its positive input and compares the waveform to a reference signal from the DAC118. The comparator116produces output signal pulses that represent the peaks that exceed the reference signal. The counter120counts the pulses and provides the count to the comparator126. The comparator126compares the count to the floating count window124and produces an output signal128based on the comparison. If the count falls within the floating count window124, the comparator126continues producing the same output signal that it was already producing. However, if the count falls outside of the floating count window124, the count discriminator circuit122pushes the floating count window124in the direction of the count. Additionally, the comparator126produces an output signal corresponding to the direction in which the floating count window124changes.

The floating count window124pushes one direction at a time. Each time a higher count is detected, the count discriminator circuit122changes the floating count window124to the higher count value, and the comparator126outputs a logic high signal. When the counts start decreasing, the count discriminator circuit122does not change the floating count window124until the count from counter120is small enough to push the bottom of the floating count window124, at which point the comparator126changes its output from a logic high level to a logic low level. The count discriminator circuit122changes the floating count window124in the downward direction corresponding to the count. The count discriminator circuit122continues to change the floating count window124in the downward direction until the counts begin to increase. Once again, the floating count window124and the value of the output signal128of the comparator126do not change until the count is high enough to exceed the top of the floating count window124. Once the count pushes the upper boundary of the floating count window124, the output signal128of the comparator126changes from a logic low level to a logic high level. Additionally, the count discriminator circuit122shifts the floating count window to match the count.

FIG. 2is a diagram200of peak counts202over time and of a corresponding output signal128over time for the metering circuit104ofFIG. 1, according to an embodiment. The diagram200further includes floating count windows204,206,208,210,212,214,216and218, which represent upper and lower boundaries that define a count differential that is less than a difference between a typical undamped count and a typical damped count of peaks of the input signal.

As the wheel102turns, the number of counts of the input signal at input114vary, as reflected in signal128. In the illustrated example, the number of peaks of the input signal vary between approximately 19 (damped signal count) and 31 (undamped signal count). However, any count range can be used provided that the count is several counts less than a count difference between the highest count and the lowest count, making it possible for the count to push the floating count window up or down.

Referring now to the peak counts202, the count value is 26 at floating count window204, which pushes the floating count window204up causing the comparator126to change its output signal128from a logic low level to a logic high level at transition205. The count value increases to 30 at floating count window206and to 31 at floating count window208, which counts push the floating count windows206and208upward; however, since the direction of the push hasn't changed, the output signal128does not transition. At window210, the count value decreases to 28; however, the floating count window210is larger than three, so the decrease from a count of 31 to a count of 28 is insufficient to shift the floating count window210down, and thus the output signal128remains at a logic high level.

At floating count window212, the value of the peak counts202has fallen to 22, pushing the floating count window212down. In response to or in conjunction with the shifting of the floating count window, the output signal128of the comparator126transitions from the logic high level to a logic low level at transition213. The value of the peak counts202falls to a count of 20 at floating count window214, pushing the floating count window214in a downward direction; however, the output signal128remains at a logic low level because the change is in the same direction as the previous change. At floating count window216, the peak counts202increase to 22; however, the floating count window is larger than two, so the increase from the count of 20 to the count of 22 is insufficient to shift the floating count window216up, and thus the output signal128remains at a logic low level.

At floating count window218, the value of the peak counts202has increased to 27, which is sufficient to shift the floating count window218up. In response to or in conjunction with the floating count window shifting, the output signal128of the comparator126transitions from the logic low level to the logic high level at transition219.

The peak counts202may vary over time as shown. At peaks220and222, the count value is 31, while at peak224, the count value is only 26. However, by utilizing a shifting of the floating count window, the variations in the peak count202can still be used to discriminate between a damped signal versus an undamped signal based on the transitions205,213, and219reflecting when the state of the system changes. Such transitions may reflect when the metallized portion of the wheel102is proximate to the inductor106of the resonant tank, for example.

While the example of the system100inFIG. 1depicted an LC tank103that was passively energized or that may have been initially energized by a power source (not shown), it should be understood that the metering circuit104may energize the LC tank103or another resonant circuit to initiate the ringing waveform. An example of a metering circuit104that can energize the resonant tank is described below with respect toFIG. 3.

FIG. 3is a block diagram of a system300including a metering circuit104employing a floating count window to determine a count according to a second embodiment. In the illustrated example, metering system300includes metering circuit104coupled to a resonant circuit103. In another embodiment, resonant circuit103may be replaced with a capacitive sense circuit, a Wheatstone bridge (magneto resistive) circuit, or other circuitry adapted to produce a measurable signal in response to a parameter to be measured. In an embodiment, resonant circuit103may be an inductor-capacitor (LC) tank circuit configured to produce a resonant signal that varies based on a rotational position of the wheel102. In an example, the resonant signal may have a first signal characteristic when a non-metallized portion of the wheel102is proximate to the resonant circuit103and may have a second (damped) signal characteristic when a metallized portion of the wheel102is proximate to the resonant circuit103.

The metering circuit104may include a pulse generator310and a sensor circuit302, which are coupled to a controller, which may be implemented as a FSM130. The FSM130may also be coupled to the MCU136and to count registers132and134. In an embodiment, the FSM130may be implemented as processor readable instructions executing on a processor or on the MCU136. In accordance with another embodiment, the FSM130may be implemented as a dedicated hardware implementation including, but not limited to, application specific integrated circuits, programmable logic arrays, and other circuit devices.

The sensor circuit302includes the comparator116having a first input coupled to the resonant circuit103to receive an input signal. The first input may also be coupled to a bias source304adapted to level shift the input signal. In an embodiment, the bias source304may level shift the input signal to a level that is approximately half of rail-to-rail voltage. The comparator116further includes a second input coupled to DAC118to receive a reference signal, and includes an output coupled to a counter120. The counter120includes an output coupled the count discriminator circuit122. In particular, the output is coupled to a first input of a comparator126, which has a second input coupled to a floating count window124and an output coupled to the FSM130. The floating count window124may include a high peak threshold306and a low peak threshold308, which define the boundaries of the floating count window or count threshold window. The comparator126is adapted to receive a count from the counter120and to compare the count to the floating count window124, and to produce an output signal128corresponding to a result of the comparison.

The FSM130includes a count detection circuit312coupled to the first input of the comparator116. In an embodiment, the count detection circuit312may determine when a count at the output of counter120is within the floating count window124. When the count is within the floating count window124, the output signal128remains unchanged. However, when the count varies from the floating count window, the FSM130causes the floating count window124to change, shifting the floating count window to match the count. Additionally, when the count causes the floating count window124to change direction relative to a previous shift, comparator126toggles the output signal128. The size of the floating count window may remain constant and may be configured to be less than an average difference between a high peak count corresponding to an undamped state of the system and a low peak count corresponding to a damped state of the system.

In an embodiment, the FSM130may cause the pulse generator310to provide an excitation signal to the resonant circuit103. The sensor circuit302may receive an input signal in response to the excitation signal. The comparator116may compare the input signal to a reference signal from the DAC118and may produce an output signal that has a logic high level when the input signal exceeds the reference signal and a logic low level when the input signal falls below the reference signal. The output of the comparator116is provided to the counter120, which counts the pulses and provides a count of the pulses to the comparator126. The comparator126compares the count to a floating count window124and produces an output signal128representing the state of the system100. In an embodiment, the output signal128of the comparator126toggles when the count causes the floating count window to shift in a different direction from a previous shift. As long as changes to the count do not push the window or continue to push the window in the same direction, the output signal128remains unchanged.

The count detection circuit312of the FSM130may monitor the count at the output of the counter120, and the FSM130may adjust the high count threshold306and the low count threshold308by the same amount. In an embodiment, the FSM130may increment both the high count threshold306and the low count threshold308when the count exceeds the floating count window, and may decrement both the high count threshold306and the low count threshold308when the count falls below the floating count threshold.

In an embodiment, the FSM130may be configured to adjust the size of the floating count window124(by adjusting one or the other of the high count threshold306and the low count threshold308), for example, when the floating count window124does not change for a period of time that exceeds a time threshold. When the floating count window124is moved by the count from counter120, the FSM130may continue to monitor the counts to determine an average high count and average low count and may configure the size of the floating count window124to be less than the difference between the average high count and average low count. In an example, the FSM130may configure the floating count window124to have a size that is less than half of the difference between the average high count and the average low count.

While the illustrated example ofFIG. 3depicts a single resonant circuit103, other types of circuits may be used, including a capacitive sense circuit, a magnetic circuit, a Wheatstone bridge circuit (magneto resistive), or other circuitry adapted to produce a measurable signal in response to a parameter to be measured. Additionally, in some embodiments, a second resonant circuit may be coupled to a second sensing circuit within the metering circuit104. In an embodiment of the metering circuit104that is configured to monitor rotation of a wheel,102sensing circuits (such as first and second resonant circuits) may be positioned adjacent to the wheel102and spaced apart from one another to provide dual measurement signals, which can be processed to determine the rate of rotation as well as the direction. In this example, as a metallized portion of the wheel is proximate to one of the resonant circuits, the input signal to the sensing circuit may be dampened. In contrast, when a non-metallized portion of the wheel102is proximate to one of the resonant circuits, the input signal to the sensing circuit may be undamped. One possible example of a metering system including a metering circuit that can receive two different resonant signals is described below with respect toFIG. 4.

FIG. 4is a block diagram of a metering system400including a metering circuit402employing a floating count window124to determine a count according to a third embodiment. The metering circuit402is configured to receive a signal from two external circuits, which in this embodiment included resonant tank circuits. In the illustrated example, the metering circuit402includes all of the elements of metering circuit104ofFIGS. 1 and 3, including sensor circuit302, FSM130, pulse generator310, MCU136, and count registers132and134. Further, the metering circuit402includes additional circuitry to facilitate operation with two input signal sources, such as resonant tank circuits.

The metering circuit402includes the pulse generator310coupled between the FSM130and an output414, which may be implemented as a pad, pin or contact location configurable to interconnect with an external circuit. The metering circuit402further includes an input418, which may be implemented as a pad, pin, or contact location configurable to interconnect with an external circuit. The input418may be coupled to the sensor circuit302.

The sensor circuit302includes the comparator116having a first input coupled to input418and to the bias source304, a second input coupled to the DAC118, and an output coupled to the counter120. The counter120includes an output coupled to a first input of the comparator126, which includes a second input coupled to the floating count window124and includes an output.

The metering circuit402further includes a pulse generator454coupled between the FSM130and an output452, which may be implemented as a pad, pin or contact location configurable to interconnect with an external circuit. The metering circuit402further includes an input458, which may be implemented as a pad, pin, or contact location configurable to interconnect with an external circuit. The input458is coupled to a sensor circuit460.

The sensor circuit460includes a comparator464having a first input coupled to the input458and to a bias source473, a second input coupled to a DAC466, and an output coupled to a counter468. In an example, the bias source473may include a voltage configured to level shift the input signal. Further, DAC466may be the same as the DAC118, depending on the implementation. The counter468includes an output coupled to a first input of a comparator470, which includes a second input coupled to a floating count window472. The comparator470further includes an output.

The metering circuit402includes a controller, which may be implemented as the FSM130. The FSM130includes outputs coupled to pulse generators310and454. Further, the FSM130includes an input coupled to the output of comparator126and an input coupled to the output of comparator470. The FSM130also includes an output coupled to count register132and an output coupled to count register134. Additionally, the FSM130includes outputs coupled to floating count windows124and472. The metering circuit402further includes a microcontroller unit (MCU)136coupled to count registers132and134. MCU136may include a plurality of connections (not shown) to communicate with other circuitry of metering circuit402(such as transceivers, memory, and other circuits).

The external resonant tank circuits may be configured to generate a resonant signal that has damping characteristics that vary based on a parameter to be sensed. In the illustrated example, the resonant circuits are LC tank circuits including a first resonant tank circuit that includes a transistor404coupled between a power supply and a node405, and including a gate coupled to output414of metering circuit402. The first resonant tank circuit further includes an inductor406and a capacitor408coupled in parallel between node405and a second power supply, such as ground. Additionally, the first resonant tank circuit is AC coupled to input418through capacitor410, which is coupled between node405and input418.

The resonant tank circuits further include a second resonant tank circuit having a transistor444coupled between a power supply and a node445, and including a gate coupled to output452of metering circuit402. The second resonant tank circuit further includes an inductor446and a capacitor448coupled in parallel between node445and a second power supply, such as ground. Additionally, the second resonant tank circuit is AC coupled to input458through capacitor450, which is coupled between node445and input458.

In an embodiment, the FSM130sends a signal to pulse generator310, causing pulse generator310to apply an excitation signal or pulse to output414. The excitation signal biases transistor404to briefly couple the power supply to node405, charging capacitor408. When the excitation signal is stopped (i.e., the pulse ends), transistor404decouples the power supply from node405. Charge stored by capacitor408is discharged into inductor406, building up a magnetic field around the inductor406and reducing the voltage stored by the capacitor408. When the capacitor408is discharged, the inductor406will have the charge stored in its magnetic field and since the inductor406resists changes in current flow, the energy to keep the current flowing is extracted from the magnetic field, which begins to decline, and the current flow will charge the capacitor408with a voltage of opposite polarity to its original charge. When the magnetic field of inductor406is dissipated, the current stops and the opposite polarity charge is stored in capacitor408. The discharge/recharge process is repeated with the current flowing in the opposite direction through the inductor406. The energy oscillates back and forth between the capacitor408and the inductor406until (if not replenished by power from an external circuit, such as the power supply through transistor404) internal resistance makes the oscillations die out. When used in conjunction with a metering wheel102that has a metallized portion, the oscillations die out faster (damped) when the metallized portion is proximate to the resonant tank circuit and die out slower (undamped) when the non-metallized portion is proximate to the resonant tank circuit.

The comparators126and470compare the counts from counters124and468, respectively, to discriminator thresholds from floating count windows124and472, respectively. The comparator126produces an output indicating a state (damped or undamped) of the system400as determined from the input signal received at input418. Similarly, the comparator470produces an output signal indicating a state (damped or undamped) of the system400as determined from the input signal received at the input458.

In an embodiment, the FSM130uses the count detection circuit312of the FSM130to monitor the pulse counts from counters120and468. The FSM130may selectively alter the floating count windows124and472when the output signals at the outputs of comparators126and470toggle. In an example, the floating count window124may have a different value from the floating count window472, and the FSM130may update the floating count windows124and472independently.

FIG. 5is a flow diagram of a method500of determining a count using a floating count window according to an embodiment. At502, a resonant signal is received at an input of a metering circuit. In an embodiment, the resonant signal may be received from an LC tank circuit. In another embodiment, the resonant signal may be received from another signal source that produces a ringing waveform.

Advancing to504, the resonant signal is compared to a peak threshold using a comparator of the metering circuit. Continuing to506, a number of peaks of the resonant signal that exceed the peak threshold are counted. In an embodiment, the peaks are counted using a counter of the metering circuit. Advancing to508, the count is compared to a count threshold window. In an embodiment, the count threshold window may be defined by a low threshold and a high threshold.

Continuing to510, if the count is greater than the count threshold window, the method500advances to512and the count threshold window is shifted up such that the top (upper count threshold) of the count threshold window matches the count. The method500then proceeds to514. At514, if shifting the threshold window up constitutes a change in direction of the movement of the floating count window, the method500advances to516and the comparator126changes the output signal128at its output in the direction of the window shift (i.e., it transitions from a logic low level to a logic high level). Otherwise, at514, if the floating count window has not changed direction, the method500continues to518and no change is made to the output signal at the output of the comparator. The method then returns to502to receive a next resonant signal.

Returning to510, if the count is not greater than the count threshold window, the method500proceeds to520. At520, if the count is less than the count threshold window, the method500proceeds to522and the count threshold window is shifted down such that the bottom of the count threshold window matches the count. The method500then proceeds to514. At514, if shifting the threshold window down constitutes a change in direction of the movement of the floating count window, the method500advances to516and the comparator126changes the output signal128at its output in the direction of the window shift (i.e., it transitions from a logic high level to a logic low level). Otherwise, at514, if the floating count window has not changed direction, the method500continues to518and no change is made to the output signal at the output of the comparator. The method then returns to502to receive a next resonant signal.

Returning to520, if the count is not less than the count threshold window, the method500advances to518, and no change is made to the output signal at the output of the comparator. The method then returns to502to receive a next resonant signal.

FIG. 6is a flow diagram of a method600of determining a count using a floating count window according to a second embodiment. At602, a count is received that corresponds to the peaks of a resonant signal. The count may be received at a first input of a comparator. Advancing to604, the count may be compared to a floating count window. The comparator may compare the count to a high threshold and/or a low threshold to determine whether the count falls within the floating count window.

Continuing to606, an output signal is selectively altered in response to comparing the count to the floating count window. In an embodiment, the output signal toggles from a first state to a second state when the count falls outside of the floating count window. In an embodiment, the output signal toggles in the direction of the count relative to the floating count window, such that if the count is below the floating count window, the output signal toggles from a logic high level to a logic low level or remains at a logic low level if the output signal is already at a logic low level.

Proceeding to608, the count window is selectively shifted in the direction of the count when the count is outside of the count window. In an example, the count window is shifted down when the count falls below the count window and is shifted up when the count is above the count window.

In an embodiment, the floating count window is shifted up to match the count when the count exceeds an upper threshold of the floating count window. In another embodiment, the floating count window is shifted down to match the count when the count falls below a lower threshold of the floating count window. In still another embodiment, the floating count window is unchanged when the count falls within the floating count window.

In an embodiment, the output signal toggles to represent a state of a system when the count falls outside of the floating count window in a direction that differs from a previous shift of the floating count window. In still another embodiment, the output signal is toggled from a logical low level to a logical high level when a previous shift of the floating count window reflected a downward shift and the count exceeds an upper threshold of the floating count window. Further, the output signal is left unchanged when the previous shift of the floating count window reflected an upward shift. In yet another embodiment, the output signal toggles from a logical high level to a logical low level when a previous shift of the floating count window reflected an upward shift and the count falls below a lower threshold of the floating count window. The output signal remains unchanged when the previous shift of the floating count window reflected a downward shift.

In conjunction with the circuits and methods described above with respect toFIGS. 1-6, the metering circuit uses a floating count window to determine when the system changes from a first state to a second state. By utilizing a floating count window, the metering circuit may accurately detect the rotational state of the wheel without calibration. Thus, the metering circuit can correctly detect changes in the metering wheel even in the face of changes in temperature and voltage that might alter a threshold voltage. Instead of having to do numerous calibrations to correct the threshold, the floating window tracks the wheel movement.

In accordance with various embodiments, the floating count window and the methods described herein may be implemented in hardware or as processor readable instructions executing on a processor or on the MCU136. In accordance with another embodiment, the floating count window and the methods described herein may be implemented using a dedicated hardware implementation including, but not limited to, application specific integrated circuits, programmable logic arrays, and other hardware devices can likewise be constructed to implement the methods described herein.

The illustrations, examples, and embodiments described herein are intended to provide a general understanding of the structure of various embodiments. The illustrations are not intended to serve as a complete description of all of the elements and features of apparatus and systems that utilize the structures or methods described herein. Many other embodiments may be apparent to those of skill in the art upon reviewing the disclosure. Other embodiments may be utilized and derived from the disclosure, such that structural and logical substitutions and changes may be made without departing from the scope of the disclosure. Moreover, although specific embodiments have been illustrated and described herein, it should be appreciated that any subsequent arrangement designed to achieve the same or similar purpose may be substituted for the specific embodiments shown.

This disclosure is intended to cover any and all subsequent adaptations or variations of various embodiments. Combinations of the above examples, and other embodiments not specifically described herein, will be apparent to those of skill in the art upon reviewing the description. Additionally, the illustrations are merely representational and may not be drawn to scale. Certain proportions within the illustrations may be exaggerated, while other proportions may be reduced. Accordingly, the disclosure and the figures are to be regarded as illustrative and not restrictive. Workers skilled in the art will recognize that changes may be made in form and detail without departing from the scope of the disclosure.