GB2540687A - Threshold transition detector, RMS measurement and filter - Google Patents

Threshold transition detector, RMS measurement and filter Download PDF

Info

Publication number
GB2540687A
GB2540687A GB1617771.9A GB201617771A GB2540687A GB 2540687 A GB2540687 A GB 2540687A GB 201617771 A GB201617771 A GB 201617771A GB 2540687 A GB2540687 A GB 2540687A
Authority
GB
United Kingdom
Prior art keywords
value
data
input
signal
stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB1617771.9A
Other versions
GB201617771D0 (en
GB2540687B (en
Inventor
Middleton Gregory
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Deep Sea Electronics Ltd
Original Assignee
Deep Sea Electronics Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Deep Sea Electronics Ltd filed Critical Deep Sea Electronics Ltd
Priority to GB1617771.9A priority Critical patent/GB2540687B/en
Priority claimed from GB1518820.4A external-priority patent/GB2534000B/en
Publication of GB201617771D0 publication Critical patent/GB201617771D0/en
Publication of GB2540687A publication Critical patent/GB2540687A/en
Application granted granted Critical
Publication of GB2540687B publication Critical patent/GB2540687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/165Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values
    • G01R19/16528Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values using digital techniques or performing arithmetic operations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R13/00Arrangements for displaying electric variables or waveforms
    • G01R13/02Arrangements for displaying electric variables or waveforms for displaying measured electric variables in digital form
    • G01R13/0218Circuits therefor
    • G01R13/0254Circuits therefor for triggering, synchronisation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R13/00Arrangements for displaying electric variables or waveforms
    • G01R13/02Arrangements for displaying electric variables or waveforms for displaying measured electric variables in digital form
    • G01R13/0218Circuits therefor
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/165Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values
    • G01R19/16566Circuits and arrangements for comparing voltage or current with one or several thresholds and for indicating the result not covered by subgroups G01R19/16504, G01R19/16528, G01R19/16533
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/175Indicating the instants of passage of current or voltage through a given value, e.g. passage through zero
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
    • G01R23/10Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage by converting frequency into a train of pulses, which are then counted, i.e. converting the signal into a square wave
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/02Measuring effective values, i.e. root-mean-square values

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

A digital filter for filtering a stream of input data and producing a corresponding stream of output data receives a series of input data samples, each having a respective value, and for each input data sample, sets the value of a corresponding output data sample according to a comparison between an accumulated value of previous input samples and a predetermined threshold. If the difference between the value of the present input sample and the current accumulated value is less than the predetermined threshold, then the accumulated value is updated by summing the present input sample with values corresponding to one or more previous input samples. If the difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, the accumulated value is updated by setting the accumulated value equal to the value of the present input sample. The accumulated value may be an average. The filter responds quickly to large changes in input but removes the influence of small variations e.g. noise.

Description

THRESHOLD TRANSITION DETECTOR, RMS MEASUREMENT AND FILTER
[0001] This invention relates to a threshold transition detector for detecting a transition of an analogue signal across a threshold, filters for filtering a stream of input data and methods for the same.
BACKGROUND
[0002] Numerous applications require the measurement and estimation of the parameters or characteristics of signals or waveforms, parameters such as frequency, root-mean-square (RMS), phase and so forth. For example, it is often necessary to measure the frequency and RMS of a current or voltage waveform associated with an alternating current power source such as generator or mains electricity supply. Conventionally, the measurement of the frequency and RMS of such periodic waveforms is based upon a measurement of the period of waveform, where the period corresponds to the time between two corresponding points in the waveform. For example, the period of an ideal sinusoid may be defined as the elapsed time between two consecutive negative to positive transitions or zero-crossings, though it is also possible to define the period of a waveform relative to an arbitrary point of a waveform where a transition across an arbitrary threshold occurs. However, the identification of transitions such as zero-crossings may be adversely affected if distortions are present in the waveform of interest as one or more false transitions may be detected where only one true transition is present. The detection of multiple transitions, or a transition at an incorrect point in a waveform, may for example lead to inconsistent frequency and RMS measurements which may in turn lead to unreliable operation of processes reliant on the frequency and RMS measurements. Consequently, the provision of a technique which provides reliable and accurate threshold transition detection and frequency measurement for periodic waveforms presents a technical problem to be solved.
[0003] However parameter measurements are obtained, it is likely that they contain an element of noise or jitter. This originates both from noise in the measured quantity and from the measurement technique. For example, it is fundamental that any digital timing function for measurement of frequency or phase results in jitter of at least one time quanta, more if factors such as interrupt latency are introduced; and analogue to digital converters introduce noise of typically several least significant bits (LSB). In a well-designed system it may be possible to reduce this noise to a level where it has little functional effect on the system which utilise the measured values, but it may still adversely affect any display of the measured value. For example, a frequency display rapidly flickering between 49.9Hz and 50.0Hz results in every numeral of the display changing rapidly resulting in the possibility of an operator misinterpreting the display. This situation can be exacerbated by a sluggish response of the display blurring the digits, for example an LCD display in a cold environment. Such noise may also increase the bandwidth required of communications links due to the constant updating of the display.
[0004] A common approach to dealing with such noise has been to apply a first order low-pass digital filter to the display value. However, a disadvantage of this approach is that this makes the display respond sluggishly to changes in measured value and at best it can only reduce the noise, not eliminate it. Another method to reduce noise is to reduce the update rate of the display to reduce the perception of jitter. However, once again this approach makes the display slow to respond to changes and does not eliminate the problem.
BRIEF SUMMARY OF THE DISCLOSURE
[0005] In accordance with an example of the present invention there is provided a threshold transition detector for detecting a transition of an analogue signal across a threshold, the detector comprising an analogue to digital convertor, ADC, adapted to receive a first analogue signal, sample said first analogue signal at a sampling rate, and output a corresponding sampled signal comprising a stream of sampled data; a digital filter arranged to filter said stream of sampled data and output a corresponding stream of filtered data; a comparator arranged to receive said stream of filtered data and switch an output of the comparator to a first state in response to a value of a received piece of filtered data exceeding a predetermined first threshold and switch said output of the comparator to a second state in response to a value of a received piece of filtered data being below a predetermined second threshold.
[0006] Distortions in periodic signals or waveforms can cause threshold transition detectors to trigger at a point or points that vary between cycles, or triggers more than once per cycle, thus giving false readings of frequency and phase of the waveform. RMS readings may also be affected if the calculation method relies on such threshold transitions. For example, a false detection may lead to a frequency measurement being double the true value. The present technique reduces the likelihood of false threshold transition detections by reliably and consistently attenuating distortions present in a waveform via digital filtering, thus helping to achieve a stable and accurate detection of threshold transitions and thus the period of a signal This in turn then assists with obtaining stable and accurate measurements of parameters such as frequency, phase and RMS values. Furthermore, the use of hysteresis such that two thresholds either side of the true threshold are used further reduces the detrimental effect of distortion in the signal on transition detection.
[0007] In accordance with another example of the present invention, the threshold transition detector comprises a signal conditioning module adapted to receive an analogue input signal, generate said first analogue signal from the analogue input signal by at least one of scaling, shifting, and filtering the analogue input signal, and provide said first analogue signal to the ADC.
[0008] In accordance with another example of the present invention, the ADC may have an input range and the signal conditioning module is adapted to scale and/or shift the analogue input signal such that the first analogue signal is within the input range of the ADC.
[0009] In accordance with another example of the present invention, the signal conditioning module comprises an analogue filter arranged to perform said filtering.
[0010] Analogue to digital converters may have limited input ranges such as amplitude for example, and if the analogue input signal does not fall solely within the input range additional distortions may be introduced into the sampled stream of data. The use of a conditioning module which scales, shifts or filters the analogue signal prior to input into the analogue to digital converter helps ensure that the analogue signal is within the input range and thus reduces the likelihood of additional distortions being introduced into the sampled signal. The shifting, scaling and filtering may be applied to one or more characteristics of the analogue signal such as amplitude and or frequency for example.
[0011] In accordance with another example of the present invention, the threshold transition detector comprises a transition detection module arranged to provide an output signal indicating a transition across a threshold by the sampled signal in response to the output of the comparator switching between the first and second states.
[0012] In order to measure a number of parameters of a signal such as frequency for example, consistent reference points in the signal are required. Transitions across a threshold indicated by a switch between output states of the comparator may provide such reference points.
[0013] In accordance with another example of the present invention, the first analogue signal is periodic and the threshold transition detector comprises a frequency detection module, the frequency detection module being arranged to receive the signals output from the transition detection module, to measure a number of samples between two corresponding transitions across the threshold by the sampled signal, and to determine, using the measured number of samples and the sampling rate, a frequency associated with the periodic waveform.
[0014] The use of corresponding threshold transitions identified using the present technique to estimate a frequency of the analogue signal enables increased accuracy frequency estimates to be made compared to existing techniques which do not include the digital filter and comparator functions of the present technique.
[0015] In accordance with another example of the present invention, the transition corresponds to a zero-crossing.
[0016] Defining the threshold transitions with respect to zero-crossings enables the present technique to be applied to conventional sinusoid type analogue signals which are common in numerous applications such as electrical and electronic engineering.
[0017] In accordance with another example of the present invention, the digital filter has a frequency response that corresponds to a frequency response of a low-pass second order filter [0018] The use of a low-pass filter with second order characteristics provides a balanced trade-off between complexity of the filtering process and a sufficiently steep roll-off of the frequency response of the filter such that sufficient attenuation is given to distortions. For example, in the case of a 50Hz electrical signal, a low-pass filter with second order characteristics and a cut-off frequency of 100Hz would attenuate sufficiently higher order harmonics.
[0019] In accordance with another example of the present invention, the digital filter has a cut-off frequency of approximately 100Hz.
[0020] The use of a low-pass digital filer with a cut-off frequency of 100Hz allows the filter to attenuate a number of higher frequency distortions that would be present in a 50Hz electrical signal whilst not significantly attenuating the fundamental frequency of the 50Hz signal.
[0021] In accordance with another example of the present invention, the analogue filter is a low-pass filter and has a cut-off frequency of approximately 1kHz.
[0022] The use of an analogue filter with a cut-off frequency of approximatelyl kHz allows the signal conditioning module to attenuate signals that may lead to aliasing when a 50Hz electrical signal is sampled at a rate of in the range of 10kHz to 100kHz, such as 40kHz for example, thus reducing the likelihood of aliasing.
[0023] In accordance with another example of the present invention, the threshold transition detector comprises a root mean square, RMS, module for determining a RMS value of the magnitude of the sampled signal, the RMS module being arranged to square the amplitude of each piece of sampled data included in a period of the periodic signal and iteratively sum the squared amplitudes, and to divide, in response to the completion of the period of the period signal, the summed value by the number of summed squared amplitudes to form a mean square value and to determine the square root of the mean square value.
[0024] RMS calculation according to this technique overcomes the need to store multiple samples prior to the averaging calculation and thus reduces the memory requirements compared to existing RMS calculation techniques. Furthermore, when combined with the improved accuracy period detection provided by the present technique, improved accuracy RMS measurements may be achieved.
[0025] In accordance with another example of the present invention, the square root of the mean square value is determined in accordance with a successive approximation algorithm.
[0026] The use of successive approximation algorithm provides a computationally efficient method to obtain the square root of the mean square value in an RMS calculation and thus reduces the computational complexity of an RMS calculation.
[0027] In accordance with another example of the present invention, the first analogue signal is a signal corresponding to an alternating current electrical signal with a frequency of approximately 50Hz.
[0028] The application of the present technique to 50Hz electrical signals enables parameter measurements of electrical signals to be quickly and accurately obtained. This in turn enables peripheral apparatus to quickly react to changes in such signal parameters. For instance, if the electrical signal is generated by an electrical generator, parameter measurements provided in accordance with the present technique enables the generator to be disconnected from a mains network or peripheral device promptly and reliably if one or more parameters of the generated signal fall outside of allowable limits.
[0029] In accordance with another example of the present invention, the threshold transition detector is arranged to receive an analogue input signal, and the apparatus further comprises display means arranged to provide an indication of at least one of a frequency, a phase angle, and an RMS value of the analogue input signal.
[0030] In accordance with another example of the present invention there is provided a control apparatus for controlling electrical apparatus with a control signal, the control apparatus comprising a threshold transition detector, wherein the threshold transition detector is arranged to receive an analogue input signal, and the control apparatus is arranged to generate said control signal in response to at least one of a frequency, a phase angle, and an RMS value of the analogue input signal deviating outside a respective range.
[0031] In accordance with another example of the present invention there is provided a method for detecting a transition of an analogue signal across a threshold, the method comprising: receiving, at an analogue to digital convertor, a first analogue signal and sampling said first analogue signal at a sampling rate, and outputting a corresponding stream of sampled data; filtering, with a digital filter, said stream of sampled data and outputting a corresponding stream of filtered data; and receiving, at a comparator, said stream of filtered data and switching an output of the comparator to a first state in response to a value of a received piece of filtered data exceeding a predetermined first threshold, and switching said output of the comparator to a second state in response to a value of a received piece of filtered data being below a predetermined second threshold.
[0032] In accordance with another example of the present invention there is provided a digital filter for filtering a stream of input data and providing a corresponding stream of output data for display, the digital filter being arranged to receive a stream of input data, each piece of input data having a respective value, and output a corresponding stream of output data, each piece of output data having a respective value, the digital filter being further arranged, in response to receiving immediately adjacent (successive) first and second pieces of said input data from the input stream, to output corresponding first and second pieces of said output data, wherein said second piece of output data has a value equal to the value of the second received piece of input data if the value of the second received piece of input data differs from the value of the first received piece of input data by more than a first predetermined amount, and wherein said second piece of output data has a value equal to the value of the first piece of output data if the value of the second piece of input data differs from the value of the first piece of input data by less than a second predetermined amount.
[0033] In accordance with another example of the present invention there is provided an apparatus comprising the digital filter, arranged to receive a stream of input data, and output a corresponding stream of output data: and a display means arranged to display said output data.
[0034] In accordance with another example of the present invention, said stream of input data is indicative of at least one of a frequency, phase angle, and RMS value of an analogue signal.
[0035] In accordance with another example of the present invention there is provided a digital filtering method for filtering a stream of input data and providing a corresponding stream of output data for display, the method comprising: receiving immediately adjacent (successive) first and second pieces of input data from the input stream and outputting corresponding first and second pieces of said output data, wherein said second piece of output data has a value equal to the value of the second received piece of input data if the value of the second received piece of input data differs from the value of the first received piece of input data by more than a first predetermined amount, and wherein said second piece of output data has a value equal to the value of the first piece of output data if the value of the second piece of input data differs from the value of the first piece of input data by less than a second predetermined amount.
[0036] Signals often have an element of jitter associated with them, such that when the value of the signal is displayed on a digital display the displayed reading may rapidly change between two values, thus making the display difficult to read. Filtering signals in order to substantially block smaller changes but allow larger changes to be passed reduces the likelihood of such jitter adversely affecting the ability of a user to read clearly the value of the signal when it is displayed.
[0037] In accordance with another example of the present invention there is provided a digital filter for filtering a stream of input data and providing a corresponding stream of output data, the digital filter being arranged to receive a stream of input data, each piece of input data having a respective value, and output a stream of output data, each piece of output data having a respective value, wherein the filter is arranged, for each piece of input data, to update an accumulated value and set the value of a corresponding piece of output data to the accumulated value, wherein, if a difference between the value of an input sample and the current accumulated value is less than a predetermined threshold, updating the accumulated value comprises summing a value corresponding to the input sample with values corresponding to one or more previous input samples, and wherein, if a difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, updating the accumulated value comprises setting the accumulated value equal to the value of the input sample.
[0038] In accordance with another example of the present invention there is provided a digital filtering method for filtering a stream of input data and providing a corresponding stream of output data, the method comprising receiving a stream of input data, each piece of input data having a respective value, and output a stream of output data, each piece of output data having a respective value, and for each piece of input data, updating an accumulated value and setting the value of a corresponding piece of output data to the accumulated value, wherein, if a difference between the value of an input sample and the current accumulated value is less than a predetermined threshold, the updating the accumulated value comprises summing a value corresponding to the input sample with values corresponding to one or more previous input samples, and wherein, if a difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, the updating the accumulated value comprises setting the accumulated value equal to the value of the input sample.
[0039] Filtering of signals is often used to reduce unwanted distortions or characteristics that may be present in signals. For example, a signal whose value is to be displayed on a display may be low-pass filtered in order to attenuate high-frequency components of the signal that may resulting in a display flickering between two or more values when the signal is displayed. However, such low-pass filtering may increase the time taken for a relatively large increase in the value of the signal to be displayed on the display as any changes in the value of the signal is spread in time by the low-pass filtering. However, the use of a filter which ‘jumps’ the output to the current input sample if the input is above a threshold amount greater than the current output allows large changes in the signal to be passed on relatively quickly whilst still reducing the presence of small changes in the signal.
[0040] In accordance with another example of the present invention there is provided a computer readable medium on which is stored computer readable instructions which when executed by a computer cause the computer to perform any of the methods described above.
BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Embodiments of the invention are further described hereinafter with reference to the accompanying drawings, in which:
Figure 1 provides a schematic diagram of a generator waveform control apparatus;
Figure 2 provides an illustration of an example periodic waveform;
Figure 3 provides an illustration of an example periodic waveform with example distortion;
Figure 4 provides a schematic diagram of a waveform parameter measurement apparatus in accordance with an embodiment of the present invention;
Figure 5 provides an illustration of threshold transition detection in accordance with an embodiment of the present invention;
Figure 6 provides an illustration of an example distorted waveform;
Figure 7 provides an illustration of a method for calculating the root-mean square of a waveform in accordance with an embodiment of the present invention;
Figure 8 provides an illustration of a method for measuring the frequency of a waveform in accordance with an embodiment of the present invention; and
Figure 9 provides an illustration of a method for updating an instrumentation display in accordance with an embodiment of the present invention.
DETAILED DESCRIPTION
[0042] There are many applications where the measurement of parameters of periodic waveforms or signals is required, such as in the control of generating sets and the monitoring of mains (utility) supplies for the purposes of control and protection for example.
[0043] Figure 1 provides a schematic diagram of a generator control application where one or more of frequency, phase, root-mean-square (RMS), and harmonics of a generated waveform are required to be estimated, calculated or measured, where these terms may be used interchangeably. In Figure 1 a generator 100 generates a waveform such as an electrical alternating (AC) current which is to be supplied to a subsequent apparatus, which in the case of an AC electrical waveform may be a mains network. However, it is often required that the waveform provided by the generator complies with predetermined requirements in terms of frequency, RMS values etc. For example, in terms of electrical generation it may be required that the generator be disconnected from the mains network by a disconnection or isolation switch 102 if the generated waveform does not comply with predetermined requirements for frequency, relative phase angle in a 3-phase system, angle between voltage and current waveforms, and harmonics. Requirements may also be placed on the RMS of an electrical waveform, where the RMS is the equivalent direct current (DC) or voltage value that would deliver the equivalent power into a purely resistive load and is one of the most commonly required measurements of the magnitude of an AC waveform. The RMS of a waveform may also be referred to as the quadratic mean.
[0044] The measurement of waveform parameters may be performed by a waveform parameter measurement module 104, which controls the operation of the disconnection switch via the use of a relay for example. The waveform parameter measurement module 104 may include further parameter measurement modules as well as control modules which are arranged to compare measured values to required values and control the disconnection switch accordingly.
[0045] Although the measurement of parameters of AC electrical waveforms is predominantly considered in this specification, the described techniques may be applied to the measurement of the parameters of any periodic waveform such as sound or radio frequency waveforms for example and used to control any appropriate apparatus or process.
[0046] Waveform Parameter Estimation [0047] In order to measure frequency, phase and harmonic content of a periodic waveform, it is common to initially detect the period of the waveform via detecting the zerocrossing points of the waveform, or alternatively a point at a consistent position on each cycle such that the time between the points is the period of the fundamental harmonic of the waveform. For example, in place of zero-crossing points corresponding transitions across a predetermined threshold may be used. Once zero-crossing points have been detected, consecutive corresponding zero-crossing points can be identified and the elapsed time between the points measured to arrive at the period of the waveform or fundamental period of the waveform. The period may then be used to calculate the various other parameter values such as frequency, RMS etc.
[0048] AC electrical waveforms and many other waveforms found in engineering science are nominally sinusoidal, however, in reality they often include both harmonic and nonharmonic distortion. Figure 2 provides an illustration of an ideal sinusoidal waveform 200 where in order to measure the frequency of the waveform the zero-crossing points 202, 204, 206, 208, 210, 212, 214, 216 are identified and the elapsed time ti between corresponding zero-crossing points, such as 206 and 210, is measured. The inverse of ti is then calculated in order to arrive at an estimate of the frequency of the waveform. The ideal sinusoid of Figure 2 has well-defined zero-crossing points and therefore zerocrossing points may be identified by monitoring the raw unconditioned waveform for transitions between positive and negative amplitudes using a simple comparator or Schmitt trigger for example. However, if the waveform of Figure 2 were to be distorted via the introduction of other higher order harmonics for example, the zero-crossing points or other threshold transitions may not be as clearly defined, thus leading to problems in identifying such transitions and thus potentially leading to inaccurate measurements of parameters of the waveform.
[0049] Figure 3 provides an illustration of a distorted sinusoid where the sinusoid may have been distorted via the introduction of higher frequency harmonics and or non-periodic interference for example. In terms of electrical supply waveforms, such distortions may result from battery chargers, motor drives, UPS systems, poorly shielded electrical equipment and the like. For electrical signals from a generator, distortions such as these may also be more severe if the impedance of the supply is higher, and the output of a generator or generating set is higher impedance than that of a mains supply.
[0050] Zero-crossing points 308, 314 and 316 are well-defined and may be detected by monitoring for a change in the polarity of the amplitude waveform. However, due to the distortion of the waveform, points 302, 304, 306, 312 each have multiple zero-crossing where a non-distorted waveform sinusoid would have only one. Consequently, if conventional zero-crossing detection were to be used, at point 304 three zero-crossings may be detected where in fact point 304 corresponds to only a single authentic zerocrossing. These incorrectly identified zero-crossing points may lead to unreliable frequency measurement. For example, taking point 304 once again, two corresponding zero-crossings i.e. two positive to negative transitions are found at 304 and therefore the frequency of the waveform may be determined to be 1/t2, which is evidently not the true frequency or fundamental harmonic of the waveform.
[0051] In terms of an electrical supply, a result of incorrect parameter estimation may be an incorrect disconnection of the supply in Figure 1 or if the measurement is presented on display, displaying an incorrect frequency measurement to an operator. Conventionally heavy filtering was applied to measurements in order to obtain stable readings and reduce the influence of incorrect detection of zero-crossing detections on parameter calculations. Although such filtering results in a delay in responding to a change in parameters, both in the display of a value to an operator and the tripping of a disconnection switch when a measurement passed a threshold, the delay was deemed acceptable. However, with regard to electrical waveforms, changes in both customer perception and in legislation governing the tripping times of alarms and disconnection switches requires ever increasing response speeds. Specific examples are the legislation governing the connection of electrical generating equipment to the mains (utility) which in several countries now require generators to disconnect in the event of voltage excursions within as little as 100ms. Consequently, heavily filtering measurements in order to compensate for incorrect measurements may no longer be appropriate.
[0052] Existing approaches intended to increase the reliability of parameter measurement via zero-crossing detection whilst avoiding filtering the measured values rely upon heavy filtering of the waveforms upon which parameter measurement is to be performed in order to attenuate the distortions. However, there are a number of disadvantages to such an approach. For example, in terms of 50Hz electrical waveforms, filters with a low enough cut-off frequency to be able to substantially reduce distortions also introduce a large phase shift, the magnitude of which is dependent on the cut-off frequency and hence on the exact component values of the filters. The introduction of such phase shifts may be problematic when measuring the relative phase between two or more waveforms such as those that may be found in a 3-phase electrical signal. Furthermore, typical capacitors used in such a filter have significant tolerance on their capacitance, such as 20% for example, and capacitance values may also change with time and temperature, thus altering the characteristics of a filter and potentially lessening the reduction in distortion. Although problematic for low frequency waveforms, the drawbacks of heavy filtering also apply to higher frequency waveforms. Consequently, existing approaches accounting for distortions in waveforms may result is parameter measurement and estimation whose accuracy and reliability may be unacceptable in many applications.
[0053] Digital Threshold Transition Detection [0054] Figure 4 provides a schematic diagram of a threshold transition detection and parameter measurement apparatus in accordance with an embodiment of the present invention. Although, the approach described below may be applied to the measurement of frequency of waveforms via monitoring transitions across any arbitrary threshold the use of zero-crossing points is predominantly considered.
[0055] In Figure 4 an analogue unconditioned waveform is first received by a scaling and shifting module 400, which may also be referred to as a conditioning module or waveform conditioning module. The scaling and shifting module 400 is arranged to scale and shift the analogue signal in amplitude such that it substantially falls within the input range of an analogue to digital converter 404 and is thus not unnecessarily distorted when being converted into the digital domain. For example, if the input range of the analogue to digital converter is Ov to 8v and the range of the analogue signal is -8V to +8V, the scaling and shifting unit 404 may scale the analogue signal by a factor of 0.5 and then positively shift the scaled waveform by +4V such that the scaled and shifted waveform now has a range of 0V to 8V and alternates either side of 4V.
[0056] Once the analogue signal has been shifted and scaled, it is passed through an anti-aliasing pre-filter 402, which is a low-pass filter that reduces the likelihood of aliasing occurring when the analogue signal is sampled by the analogue to digital converter 404. More precisely, in accordance with the Nyquist criteria a sampling rate should be at least double the highest frequency component of the signal which is to be sampled. Consequently, the filter 402 should be a low-pass filter with a cut-off frequency of less than or equal to half the sampling frequency of the analogue to digital converter. In terms of a 50Hz AC signal and a sampling rate of 40kHz, any low-pass filter with a cut-off frequency of below 20kHz would be sufficient but due to the gradual attenuation (roll-off) associated with the frequency response for frequencies above the cut-off frequency, a lower cut-off frequency may be beneficial, for example 1kHz may be used.
[0057] Once the analogue signal has been filtered by the pre-filter 402 it is sampled by an analogue to digital converter 404, which samples the analogue signal at a sampling rate to form a stream of data in the digital domain. The sampling rate at which the analogue signal is sampled is dependent on the frequency content of the analogue signal and the accuracy with which the frequency and RMS measurements etc. are required to be performed. For the example of a 50Hz AC electrical signal, a sampling rate of 40kHz may be sufficient, although both a higher and lower sampling rate may also be used. As well as the frequency content of the analogue signal and the desired accuracy of frequency measurement, the cost and resources consumed by an analogue to digital converter may also be taken into consideration. For example, an analogue to digital converter with a higher sampling rate may increase the accuracy of frequency measurements but it is also likely to consume more power, cost an increased amount and output an increased volume of data. Likewise, the number of bits used per sample also presents a trade-off between accuracy of the sampling, the cost of the analogue to digital converter and the volume of data produced by the analogue to digital converter.
[0058] In order to achieve accurate parameter estimation the sampling rate should be precisely controlled. Typically control of sampling rate may be achieved by using a timer peripheral within a microcontroller to generate a regular signal to the analogue to digital converter to start a conversion, the timer itself using the microprocessor’s clock, which itself may be based on a quartz crystal, as a time base [0059] Once a stream of sampled data representing the analogue input signal is formed, the stream of sampled data is filtered by a digital low-pass filter 406 to form a filtered stream of data in which harmonic frequencies or other signals which are distorting the waveform are attenuated. The characteristics of the low-pass filter 404 may be tailored to the specific application and the anticipated distortions. For example, in terms of a 50Hz electrical waveform the cut-off frequency of such a filter may be 100Hz such that all harmonics apart from the fundamental frequency are attenuated to some extent.
Depending on the application, the cut-off frequency of the filter may be higher or lower in frequency and in some examples may be a band-pass filter or high-pass filter if lower and or higher frequency distortions are present in the waveform.
[0060] The digital filter 406 may be of any order i.e. first, second, third etc. but the order represents a trade-off between complexity and the roll-off of the filter. For a signal with a frequency of 50Hz and filter with a cut-off frequency of 100Hz, a second order filter may be sufficient to provide the roll-off required to attenuate higher frequencies sufficiently such that the associated distortion is sufficiently reduced. However, a higher order filter may be required if the frequency of the distortions is closer to the frequency of interest in the waveform.
[0061] The order of a filter corresponds to the rate of ‘roll-off’ of the filter, for example a first order filter has a roll-off of -20dB per decade on a Bode plot of frequency against amplitude, a second order filter has a roll-off of -40dB per decade and so forth. Although filters are referred to as a second order filter or fourth order filter, these terms refer to their frequency response characteristics and such filters may be formed from cascading two first order or two second order filters, respectively, where the component filters will each have a cut-off frequency equal to that of the overall filter. For example, a filter with the characteristics of a second order filter and which is suitable for filtering higher frequency components from a 50Hz AC waveform, may be formed form two cascaded first order filters each with a cut-off frequency of 100Hz.
[0062] The digital filter(s) used to form the filter 406 may be finite impulse response or infinite impulse filters but in some examples it may be advantageous to use a pair of first order infinite impulse response filters for computational efficiency purposes. An example first order digital filter is given by the equation y[n] = b0x[n] +aiy[n-1] where x[n] is the input signal, y[n] is the output signal, a-\ is the feedback coefficient, bo is the feed forward coefficient, n = 0 represents the current sample and n = -1 represents the last sample. To achieve a finite impulse response the constraint bO + a1 = 1 should be met.
[0063] Although digital filters introduce a phase shift to the filtered stream of data dependent on their order, exactly the same shift will be applied to all waveforms of the same fundamental frequency and thus they will cancel out and not affect any measurement value nor will they vary with temperature as is the case with analogue filters due to their physical components.
[0064] Furthermore, unlike analogue filters, digital filters have no component tolerances. Therefore if the same digital filtering algorithm is applied to multiple waveforms at the same sampling rate, and the waveforms are of the same frequency, identical phase shifts will be introduced which will cancel out when calculating frequency, phase or RMS value.
[0065] Once the sampled stream of data has been filtered by the digital filter 406, the filtered data stream is received by a comparator 408 arranged to produce an output which represents the amplitude of the sampled stream of data relative to a threshold, such as zero for example. For instance, if the filtered stream of data with a range of 0V-8V is shifted to be bipolar by a shifter present between the analogue to digital converter 404 and the comparator 408, the comparator may switch a digital output to T if the sampled stream of data exceeds 0V and the digital output to Ό’ if it is below 0V. Equivalently, if the filtered waveform is not shifted and thus unipolar, the threshold may be chosen to be 4V and the same timing of crossing points will be obtained.
[0066] In order to increase the reliability of the comparator, a degree of hysteresis may be introduced when identifying whether the waveform has switched polarity rather than simply switching polarity due to any remaining distortion in the waveform. In particular, the hysteresis may be introduced into the comparator so that any slight variations around the threshold that remain after the filtering procedure are less likely to result in a false detection of a transition. In some examples hysteresis of between 0% and 5% of the full scale value may be sufficient for a 50Hz electrical waveform but a decreased or increased level or hysteresis may also be used depending on the level of distortion remaining in the filter data stream.
[0067] Figure 5 provides an illustration of the filtered data stream and the action of the comparator when zero-crossings are to be detected. Even though zero-crossings are to be detected in Figure 5, i.e. the true threshold is zero, due to the introduction of hysteresis the comparator is arranged to provide an output of T when the waveform exceeds a first threshold 502 and switch to an output Ό’ when the waveform drops below a second threshold 504.
[0068] Although the use of hysteresis reduces the likelihood of falsely detecting a transition, the hysteresis results in a transition being registered after the true transition has occurred. For example, a transition at point 506 is actually registered at point 508, which may lead to inaccurate frequency estimation. In order to reduce such potential inaccuracies, presuming the waveform is substantially linear between the two thresholds 502 and 504, the time midway between the transitions across the T and Ό’ thresholds may be taken to be the true transition time or zero-crossing point. However, in an analogous manner to the introduction of phase shifts by the filter, the delay introduced by the hysteresis will be consistent. Therefore if a period of a waveform is being measured by measuring the time between two consecutive negative to positive transitions, the detection of each zero crossing will be delayed by the same amount and thus cancel out. The measurement of the period will therefore be unaffected.
[0069] Once zero-crossings in the filtered stream of data have been identified by the comparator, consecutive corresponding crossings may be detected via identifying consecutive positive to negative or negative to positive transitions as described with reference to Figure 2 i.e. those at 0 and 2π for an ideal sinusoid. This process may be performed within the comparator or may be performed by a following frequency measurement module 412.
[0070] The frequency measurement module 412 is arranged to receive an indication of the zero-crossings identified by the threshold transition module 410, to measure the elapsed time between consecutive corresponding zero-crossing points by measuring the number of samples between these zero-crossing points, and then invert this measured elapsed time in order to arrive at the frequency of the waveform in Hertz. The frequency of a waveform may be calculated by counting the number of samples between successive zero crossings and applying the formula:
Frequency = sampling rate/samples
For higher resolution measurement the number of samples in n successive cycles/periods can be counted such that errors are distributed over a plurality of cycles. In such a case the following formula may be applied:
Frequency = (n x sampling rate) / samples
The cost of this increased resolution is added delay in the response to a change in frequency so a trade-off exists between speed and accuracy.
[0071] In examples where the filtered waveform has a more complex structure than a conventional sinusoid, a sequence of positive to negative or negative to positive transitions may indicate the beginning or end or a period of the waveform and therefore the frequency of the waveform may be calculated with respect to these sequences.
[0072] Although the zero crossings detected will lag the true zero crossing due to the filter’s phase shift, this does not substantially affect the parameter measurement as exactly the same shift will be applied to all transitions and to all waveforms and thus they will cancel out and not affect any measurement value. The zero-crossings detected can therefore be used to measure frequency, synchronisation angle, current lag/lead and vector shift (VS), RMS etc.
[0073] The frequency and or threshold transitions of a waveform may be required in order to estimate other parameters of the waveform and therefore according to some embodiments of the present invention the apparatus of Figure 4 may include one or more other measurement modules such as a phase measurement module 414, a RMS measurement module 416 and a harmonic detection module 418 for example.
[0074] In many applications the phase of a waveform or the relative phase between waveforms may be required to be calculated. In terms of relative phase, the phase measurement module 414 may perform phase measurements by identifying corresponding points such as zero-crossings on two waveforms provided from one or more other channels 415 and then use the measured frequency and the elapsed time between the correspondingly points on the two waveforms to calculate the phase lag or advance.
[0075] Figure 6 provides an illustration of an example of a scaled analogue 60Hz 3-phase AC waveform prior to any filtering, shifting or scaling where there are 12 ringing pulses superimposed on each cycle of each phase. Once the waveform is digitised, filtered and zero-crossings identified for each phase, relative phase differences or relative phase measurements between the three phases may be calculated by the phase measurement module 414. For example, in Figure 6 waveforms 600, 602 and 604 each correspond to one of the 3 phases and the phase differences between 600, 602 and 604 may be measured by identifying corresponding points on each waveform such as negative to positive zero-crossings and the time between them. More precisely, the phase angle/difference between any two channels may be calculated by counting the number of samples between corresponding zero-crossings of one channel and that of the other, for example between a voltage and its corresponding current. The following formula is then applied:
Lag angle = (samples x 360) / (sampling rate / frequency) [0076] In Figure 4 the processing of a waveform is shown for a single waveform but in some cases, such as that of a 3-phase AC signal, there may be multiple phases or waveforms. In these cases each phase or waveform may be processed by a separate channel where each channel has at least its own digital filter and threshold transition detection module, separate from the other channels.
[0077] Root-Mean-Square Calculation [0078] In addition to frequency estimation, another common value required to be calculated for periodic waveforms is an RMS value. Referring back to the apparatus of Figure 4, such a calculation may be performed by the RMS calculation module 416 and may utilise the zero-crossing positions identified by the threshold transition detection module 410 and the sampled stream of data output from the analogue to digital converter 404.
[0079] The RMS of a waveform is commonly calculated over one or more periods of the waveform but in some examples, where a waveform possesses a degree of symmetry, a fraction of cycle may also be used such that RMS values can be calculated with a reduced delay. Conventional RMS calculation approaches often store the values of all the samples used in the RMS calculations and thus have substantial memory requirements. However, in accordance with the algorithm illustrated in Figure 7 and described below, the RMS of a waveform may be calculated with reduced memory requirements.
[0080] RMS is an absolute value as opposed to a relative value, therefore prior to calculating the RMS it may be necessary to scale or calibrate the samples output from the analogue to digital converter to counteract the effect of any hardware tolerances on the RMS calculation. Consequently, once the samples have been gathered at step 700 by a sample acquisition module, which may gather the samples from the analogue to digital converter 404, the samples are calibrated at step 702 by a sample calibration module. Once calibrated, from a starting point in the filtered waveform, each following sample is squared at step 704 by a squaring module and added to an accumulator value at 706 by an accumulator module. A counter is incremented to record the number of accumulated samples and when a zero-crossing is detected the accumulated value is divided at step 708 by the number of samples to give a mean of squares using a dividing module. The accumulated value and counter are then cleared to zero to begin the next cycle. The mean of squares value is then square rooted at step 710 by a square rooting module to arrive at the RMS value for the cycle of the waveform. Preferably the square root should be calculated using an efficient successive approximation technique such as Newton’s or the Babylonian method to obtain the RMS value. Once the RMS value is obtained the value may be displayed, utilised in a control or monitoring modules or in some examples may be fed to an intelligent filter module described below.
[0081] The algorithm illustrated in Figure 7 requires only one accumulated total to be stored and therefore reduces the memory requirements compared to existing techniques which store each individual value and then perform a form of batch processing on the stored values on the completion of each cycle or cycles to calculate the RMS value. Furthermore, the use of a successive approximation algorithm reduces the computational complexity of calculating the RMS values compared to conventional techniques. The combination of reduced memory and processing requirements therefore allows the algorithm to be implemented on smaller, more cost effective microcontrollers.
[0082] The proposed RMS method may be used independently of the other modules of Figure 4 but it may be advantageous if it is used in combination with the threshold transitions detection and or frequency detection of Figure 4. In particular, due to the improved accuracy of zero-crossings and frequency measurement achieved by the proposed parameter measurement technique, a cycle of a waveform may be more accurately detected. Consequently, in order to achieve a same level of error the RMS may be averaged over fewer cycles of the waveform compared to existing parameter measurement techniques. This in turn allows RMS values to be measured more quickly with a lessened impact on the accuracy of the measurement. In terms of electrical generation, RMS with reduced latency allows apparatus such as 104 in Figure 1 to react more quickly to changes in the electrical waveform.
[0083] In addition to the calculation of frequency, phase and RMS values, the filtered stream of data may also be processed by a harmonic detection module 418 in order to detect one or more harmonics present in the waveform. Harmonics may be introduced into waveforms via a number of mechanism, for example for AC electrical waveforms apparatus such as battery charges may introduce harmonics of the fundamental 50Hz frequency.
[0084] Harmonics may be detected in a number of ways, for instance the sampled stream of data may processed using a Fast Fourier Transform (FFT) in order to identify and or extract one or more harmonics. Such a process of harmonic identification/extraction requires the accurate identification of zero-crossing points or corresponding points in a waveform. Therefore the output from the previously described threshold transition detection may also be required as well as the stream of sampled data output from the analogue digital converter in order to perform harmonic detection.
[0085] Alternatively, the stream of sampled data may be filtered by a band-pass filter and the frequency of any harmonics or the dominant harmonic in the band-pass frequencies may be established via the techniques described above for measuring frequency.
Harmonic detection may also require filtering in addition to that provided by filter 406 or the filter 406 may be adapted according to the harmonics that are to be detected. For example, if multiple parameter estimation channels may be used, where modules such as the frequency measurement module of the apparatus of Figure 4 is reproduced for each channel and the modules of each channel are adjusted to focus on a particular harmonic.
In such an arrangement, the filter module 406 may be adjusted to be low-pass, band-pass or high-pass filter according to the harmonics or other frequency components which are to be detected and analysed.
[0086] In accordance with some embodiments, the waveform parameter estimation apparatus illustrated in Figure 4 may include a control module 420 which is arranged to control the parameter measurement or detection modules. The control module may also be arranged to receive the results of the measurement or detection processes and utilise the results to monitor the waveform. For example, the control module may control the number of periods of the waveform that are used to calculate the RMS value and, in the case of a generator application illustrated in Figure 1, may control a disconnection or isolation switch that is configured to disconnect the generator from the mains networks, whereby the generator may be disconnected from the mains network if one or more of the waveform parameters fall outside of required limits.
[0087] Figure 4 illustrates a waveform parameter estimation apparatus, however subsets of the modules of Figure 4 may be used without requiring the remaining modules to be present. For example, if only frequency is to be measured, modules 414, 416, and 418 may not be required. Likewise, if the input signal waveform falls completely within the input range of the analogue to digital converter or its maximum frequency content is below half the bandwidth of the analogue to digital converter, modules 400 and 402 may not be required.
[0088] As well as using threshold transition detection to establish zero-crossings for the purposes of parameter estimation, the modules 404, 406, 408 necessary for threshold transition detection may be used in isolation as a threshold transition detector.
Furthermore, the modules may be allocated different labels although their function may be unchanged.
[0089] In Figure 8 a simple zero-crossing detection routine in accordance with an embodiment of the present invention is illustrated. Firstly, at step 800 a waveform is sampled to obtain a sampled data stream. The sampled waveform is then filtered at 802 by a low-pass filter with second order characteristics in order to attenuate any distortions present in the waveform and form a filtered data stream. At the 804 the filtered data stream may then be processed by a Schmitt trigger in order to provide a logical output conveying the value of the signal relative to a threshold and to reduce the occurrence of any remaining false transitions. At step 806 transitions of the same direction between the two output states of the Schmitt trigger are then used to establish the fundamental frequency of the waveform. However, in some cases step 806 may simply entail zero-crossing or threshold crossing detection where the result of the detection are used at a peripheral apparatus.
[0090] As previously mentioned, in order to improve accuracy, the estimation of parameters such as frequency, RMS and phase are often averaged out of a number of cycles of waveform. Although such averaging reduces the impact of inaccurate cycle estimation, latency is introduced into the estimation process. However, the improved zerocrossing or other threshold transition detection of the present invention allows more accurate cycle/period estimation to be achieved and therefore little or no averaging is required to achieve the same accuracy of parameter estimation as conventional techniques. This therefore enables parameter estimates to be obtained with reduced latency and thus allows peripheral apparatus which utilises the estimates to react more quickly to changes in the waveform. Alternatively, if low latency parameter estimates are not required, parameter estimates may be provided by the present invention with the same latency as conventional techniques but with a higher accuracy.
[0091] Intelligent Filtering [0092] As mentioned above, however parameter measurements are obtained, it is likely that they contain an element of noise or jitter. This originates both from noise in the measured quantity and from the measurement technique. For example, it is fundamental that any digital timing function for measurement of frequency or phase results in jitter of at least one time quanta, more if factors such as interrupt latency are introduced; and analogue to digital converters introduce noise of typically several least significant bits (LSB). In a well-designed system it may be possible to reduce this noise to a level where it has little functional effect on the system which utilise the measured values, but it may still adversely affect any display of the measured value. For example, a frequency display rapidly flickering between 49.9Hz and 50.0Hz results in every numeral of the display changing rapidly resulting in the possibility of an operator misinterpreting the display. This situation can be exacerbated by a sluggish response of the display blurring the digits, for example an LCD display in a cold environment. Such noise may also increase the bandwidth required of communications links due to the constant updating of the display.
[0093] A common approach to dealing with such noise has been to apply a first order low-pass digital filter to the display value. However, a disadvantage of this approach is that this makes the display respond sluggishly to changes in measured value and at best it can only reduce the noise, not eliminate it. Another method to reduce noise is to reduce the update rate of the display to reduce the perception of jitter. However, once again this approach makes the display slow to respond to changes and does not eliminate the problem.
[0094] In accordance with an example of the present invention, an intelligent filtering module is proposed which addresses a number of the disadvantages associated with conventional methods for stably displaying parameter measurements. In particular, the module reduces the jitter whilst maintaining a fast response to changes in measured value.
[0095] The intelligent filter module consists of two stages, which may be used in combination or separately. Firstly, a first order low-pass digital filter, with the added function that the output jumps to the input value if the difference exceeds a predetermined threshold, filters the received value. Secondly, the output of the filter is processed by a filter or function that only passes on a value when it has changed by more than a predetermined amount from the last value that was passed on, thus substantially removing jitter that may be present in the output of a low-pass filter. The low-pass ‘jump’ filter may be implemented by most means but an Infinite Impulse Response (MR) filter with coefficients chosen to provide a finite response may be preferable as it presents a computationally efficient implementation.
[0096] The input samples to the digital ‘jump’ filter may be scaled to match the current filter output and if they differ from the current output by more than a threshold amount, the filter output is updated to the new value thus effectively jumping the output of the filter instantly to the new input. The updated output is then utilised for the subsequent filtering calculations. If the threshold amount is not exceeded, a new filter output is calculated from the new input and current output samples as usual. In terms of a 230V electrical generation application, the threshold may be 0.5V and the output of the filter is ‘jumped’ if an input sample differs from the current output by more than 0.5V. By virtue of this arrangement high frequency small scale changes in the value are substantially blocked but substantial jumps in a value are passed on substantially immediately thus allowing high frequency large scale changes to pass through the filter faster than they would in a conventional low-pass filter.
[0097] In terms of a conventional digital filter which comprises an “accumulated value” upon which the output of the filter is based, where the calculation of the accumulated value may for example include a summation to form an average or weighted average of one or more previous input values, the digital ‘jump filter’ may be described as follows. Each input sample is compared to a current accumulated value, which for example may also be the current output value, and if the these values differ by less than a predetermined threshold the accumulated value is updated as normal using the input value i.e. summation/averaging and the output set accordingly. However, if the values differ by more than the predetermined threshold, the accumulated value is set to the input value, thus the output value is jumped to the input value when a relatively large change in the signal is experienced.
[0098] The output of the digital ‘jump’ filter is then compared with the last output of the intelligent filter module and if it differs by more than a predetermined amount, the output of the intelligent module is updated, otherwise it remains unchanged. This results in the removal of the remaining noise in the measured value without delaying any rapid change in value and hence any processes based on it. For example, in a 230V electrical generation application the predetermined amount may be chosen to be one decimal place such that only changes in a value which exceed 0.1V are output by the intelligent filtering module.
[0099] Figure 9 provides a diagram illustrating the steps performed by such an intelligent filter module. Firstly, at step 900 the raw data values are acquired by a sample or instrumentation acquisition unit and at step 902 the raw data values are filtered by a digital low-pass filter with an intelligent jump function (digital ‘jump’ filter) and a cut-off frequency low enough to substantially remove the noise and jitter from the data samples. If the input sample of the filter differs from the current output by more than a predetermined threshold the output value of the filter jumps to the new input with no delay.
[00100] Since the output of a low pass filter always includes at least one bit of noise, the step 904 is used to remove it, though the process of step 904 may be used separately from the low pass filter as a stand-alone filter. The output of the low-pass filtering step 902 is compared with a stored value that is currently output by the intelligent filtering module, if they differ by less than a predetermined threshold then the value output by the intelligent filtering module is left unchanged. However, if values differ by more than the threshold then the output of the intelligent filtering module is set to the output of the low-pass filter.
[00101] Equivalently, but in terms of consecutive samples of a sampled data stream input into such a filter, if first and second input samples are input which correspond in time to first and second output samples, the value of the second input sample is initially compared with the value of the first output sample. If these values differ by less than the predetermined threshold then the second output sample is set to be equal to the first output sample (i.e. the output value of the filter is left unchanged). Alternatively, if the values differ by more than the predetermined threshold compared, the second output sample is set to the second input sample and the change input value between the first and second input samples is passed to the output of the filter.
[00102] A measured value generally consists of a large stable component with a much smaller unstable noise component superimposed on it. The two stages of the intelligent filtering module filters out the noise but recognises when the stable component changes significantly, and passes that change through immediately thus resulting in a stable but responsive display. Consequently, a stable instrumentation display that is unlikely to be misread is achieved, but without any sluggishness in responding to changes in value -unlike that associated with heavily low-pass filtered measured values. This in turn enables any control apparatus, trip, disconnection or alarm based on that instrument or associated measurement to respond very rapidly whilst not increasing the risk of false tripping.
[00103] The approaches to zero-crossing detection or threshold transitions detection described above result in a number of advantages. High frequency distortions i.e. those above the fundamental frequency of interest, such as those shown in Figures 3 and 6 can cause a conventional zero crossing detector to trigger at a point that varies between cycles, or triggers more than once per cycle, thus giving false readings of frequency and phase. RMS readings will also be affected if the calculation method relies on zero crossing detection. A false reading can easily be as severe as 100Hz instead of 50Hz resulting in an immediate alarm and typically a false tripping out of a generating set or mains supply. The presently proposed approaches reduce these detrimental effects by reducing distortions, thus ensuring a stable and accurate zero-crossing detection and consequently stable and accurate measurements of period, frequency, phase and RMS values of a waveform.
[00104] In addition to improved accuracy RMS values, in accordance with the proposed techniques, RMS values may also be obtained more quickly and with a lower computational complexity compared to existing approaches. More specifically, a reading once per cycle or possibly every two cycles may be obtained with an error level normally associated with an averaged value, thus the RMS may respond rapidly and accurately to changes in value. In terms of electrical generation, this in turn allows for rapid tripping of alarms as required by many standards for mains decoupling. This is in contrast to conventional approaches of simply squaring and averaging with a rolling low pass filter which result in a very much slower response and long tripping times. The proposed RMS calculation technique also avoids having to store large volumes of sample data, as would be needed if samples of a full cycle or cycles were stored and then passed to a function to calculate its RMS value. This greatly reduces the amount of RAM required in the microcontroller and consequently its cost.
[00105] The approaches to parameter measurement and instrumentation control described above may be implemented using any appropriate means. For example, they may be implemented in hardware, software or a combination of the two. When implemented in software, computer readable instructions or code embodying the above described techniques may be stored on a computer readable medium or transmitted over a communications network. These instructions when executed by a computer cause the computer to perform the above described techniques.
[00106] Throughout the description and claims of this specification, the words “comprise” and “contain” and variations of them mean “including but not limited to”, and they are not intended to (and do not) exclude other moieties, additives, components, integers or steps. Throughout the description and claims of this specification, the singular encompasses the plural unless the context otherwise requires. In particular, where the indefinite article is used, the specification is to be understood as contemplating plurality as well as singularity, unless the context requires otherwise.
[00107] Features, integers, characteristics, compounds, chemical moieties or groups described in conjunction with a particular aspect, embodiment or example of the invention are to be understood to be applicable to any other aspect, embodiment or example described herein unless incompatible therewith. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and/or all of the steps of any method or process so disclosed, may be combined in any combination, except combinations where at least some of such features and/or steps are mutually exclusive. The invention is not restricted to the details of any foregoing embodiments.
The invention extends to any novel one, or any novel combination, of the features disclosed in this specification (including any accompanying claims, abstract and drawings), or to any novel one, or any novel combination, of the steps of any method or process so disclosed.
[00108] The reader's attention is directed to all papers and documents which are filed concurrently with or previous to this specification in connection with this application and which are open to public inspection with this specification, and the contents of all such papers and documents are incorporated herein by reference.

Claims (24)

1. A digital filter for filtering a stream of input data and providing a corresponding stream of output data, the digital filter being arranged to receive a stream of input data, each piece of input data having a respective value, and output a stream of output data, each piece of output data having a respective value, wherein the filter is arranged, for each piece of input data, to update an accumulated value and set the value of a corresponding piece of output data to the accumulated value, wherein, if a difference between the value of an input sample and the current accumulated value is less than a predetermined threshold, updating the accumulated value comprises summing a value corresponding to the input sample with values corresponding to one or more previous input samples, and wherein, if a difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, updating the accumulated value comprises setting the accumulated value equal to the value of the input sample.
2. A digital filtering method for filtering a stream of input data and providing a corresponding stream of output data, the method comprising receiving a stream of input data, each piece of input data having a respective value, and output a stream of output data, each piece of output data having a respective value, and for each piece of input data, updating an accumulated value and setting the value of a corresponding piece of output data to the accumulated value, wherein, if a difference between the value of an input sample and the current accumulated value is less than a predetermined threshold, the updating the accumulated value comprises summing a value corresponding to the input sample with values corresponding to one or more previous input samples, and wherein, if a difference between the value of the input sample and the current accumulated value is greater than the predetermined threshold, the updating the accumulated value comprises setting the accumulated value equal to the value of the input sample.
3. A digital filter for filtering a stream of input data and providing a corresponding stream of output data for display, the digital filter being arranged to receive a stream of input data, each piece of input data having a respective value, and output a corresponding stream of output data, each piece of output data having a respective value, the digital filter being further arranged, in response to receiving immediately adjacent (successive) first and second pieces of said input data from the input stream, to output corresponding first and second pieces of said output data, wherein said second piece of output data has a value equal to the value of the second received piece of input data if the value of the second received piece of input data differs from the value of the first received piece of input data by more than a first predetermined amount, and wherein said second piece of output data has a value equal to the value of the first piece of output data if the value of the second piece of input data differs from the value of the first piece of input data by less than a second predetermined amount.
4. Apparatus comprising: a digital filter in accordance with claim 3, arranged to receive a stream of input data, and output a corresponding stream of output data: and a display means arranged to display said output data.
5. Apparatus in accordance with claim 4, wherein said stream of input data is indicative of at least one of a frequency, phase angle, and RMS value of an analogue signal.
6. A digital filtering method for filtering a stream of input data and providing a corresponding stream of output data for display, the method comprising: receiving immediately adjacent (successive) first and second pieces of input data from the input stream and outputting corresponding first and second pieces of said output data, wherein said second piece of output data has a value equal to the value of the second received piece of input data if the value of the second received piece of input data differs from the value of the first received piece of input data by more than a first predetermined amount, and wherein said second piece of output data has a value equal to the value of the first piece of output data if the value of the second piece of input data differs from the value of the first piece of input data by less than a second predetermined amount.
7. A threshold transition detector for detecting a transition of an analogue signal across a threshold, the detector comprising: an analogue to digital convertor, ADC, adapted to receive a first analogue signal, sample said first analogue signal at a sampling rate, and output a corresponding sampled signal comprising a stream of sampled data; a digital filter arranged to filter said stream of sampled data and output a corresponding stream of filtered data; a comparator arranged to receive said stream of filtered data and switch an output of the comparator to a first state in response to a value of a received piece of filtered data exceeding a predetermined first threshold and switch said output of the comparator to a second state in response to a value of a received piece of filtered data being below a predetermined second threshold.
8. A threshold transition detector in accordance with claim 7, further comprising a signal conditioning module adapted to receive an analogue input signal, generate said first analogue signal from the analogue input signal by at least one of scaling, shifting, and filtering the analogue input signal, and provide said first analogue signal to the ADC.
9. A threshold transition detector as claimed in claim 8, wherein the ADC has an input range and the signal conditioning module is adapted to scale and/or shift the analogue input signal such that the first analogue signal is within the input range of the ADC.
10. A threshold transition detector as claimed in claim 8 or claim 9, wherein the signal conditioning module comprises an analogue filter arranged to perform said filtering.
11. A threshold transition detector as claimed in any one of claims 7 to 10, wherein the threshold transition detector comprises a transition detection module arranged to provide an output signal indicating a transition across a threshold by the sampled signal in response to the output of the comparator switching between the first and second states.
12. A threshold transition detector as claimed in claim 11, wherein the first analogue signal is periodic and the threshold transition detector comprises a frequency detection module, the frequency detection module being arranged to receive the signals output from the transition detection module, to measure a number of samples between two corresponding transitions across the threshold by the sampled signal, and to determine, using the measured number of samples and the sampling rate, a frequency associated with the periodic waveform.
13. A threshold transition detector as claimed in claim 11 or claim 12, wherein the transition corresponds to a zero-crossing.
14. A threshold transition detector as claimed in any one of claims 7 to 13, wherein the digital filter has a frequency response that corresponds to a frequency response of a low-pass second order filter.
15. A threshold transition detector as claimed in any one of claims 7 to 14, wherein the digital filter has a cut-off frequency of approximately 100Hz.
16. A threshold transition detector as claimed in claim 10, or in any one of claims 11 to 15 as depending from claim 10, wherein the analogue filter is a low-pass filter and has a cut-off frequency of approximately 1kHz.
17. A threshold transition detector as claimed in claim 12, or in any one of claims 13 to 16 as depending from claim 12, wherein the threshold transition detector comprises a root mean square, RMS, module for determining a RMS value of the magnitude of the sampled signal, the RMS module being arranged to square the amplitude of each piece of sampled data included in a period of the periodic signal and iteratively sum the squared amplitudes, and to divide, in response to the completion of the period of the period signal, the summed value by the number of summed squared amplitudes to form a mean square value and to determine the square root of the mean square value.
18. A threshold transition detector as claimed in claim 17, wherein the square root of the mean square value is determined in accordance with a successive approximation algorithm.
19. A threshold transition detector as claimed in any one of claims 7 to 18, wherein the first analogue signal is a signal corresponding to an alternating current electrical signal with a frequency of approximately 50Hz.
20. Apparatus comprising a threshold transition detector in accordance with any one of claims 7 to 19, wherein the threshold transition detector is arranged to receive an analogue input signal, and the apparatus further comprises display means arranged to provide an indication of at least one of a frequency, a phase angle, and an RMS value of the analogue input signal.
21. Control apparatus for controlling electrical apparatus with a control signal, the control apparatus comprising a threshold transition detector in accordance with any one of claims 7 to 19, wherein the threshold transition detector is arranged to receive an analogue input signal, and the control apparatus is arranged to generate said control signal in response to at least one of a frequency, a phase angle, and an RMS value of the analogue input signal deviating outside a respective range.
22. A method for detecting a transition of an analogue signal across a threshold, the method comprising: receiving, at an analogue to digital convertor, a first analogue signal and sampling said first analogue signal at a sampling rate, and outputting a corresponding stream of sampled data; filtering, with a digital filter, said stream of sampled data and outputting a corresponding stream of filtered data; and receiving, at a comparator, said stream of filtered data and switching an output of the comparator to a first state in response to a value of a received piece of filtered data exceeding a predetermined first threshold, and switching said output of the comparator to a second state in response to a value of a received piece of filtered data being below a predetermined second threshold.
23. A computer readable medium on which is stored computer readable instructions which when executed by a computer cause the computer to perform the method of claim 2, claim 6, or claim 22.
24. A threshold transition detector, apparatus, control apparatus, method, digital filter, digital filtering method, or computer readable medium substantially as hereinbefore described with reference to the accompanying drawings.
GB1617771.9A 2014-07-30 2014-07-30 Digital filter Active GB2540687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
GB1617771.9A GB2540687B (en) 2014-07-30 2014-07-30 Digital filter

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB1617771.9A GB2540687B (en) 2014-07-30 2014-07-30 Digital filter
GB1518820.4A GB2534000B (en) 2014-07-30 2014-07-30 Digital filter

Publications (3)

Publication Number Publication Date
GB201617771D0 GB201617771D0 (en) 2016-12-07
GB2540687A true GB2540687A (en) 2017-01-25
GB2540687B GB2540687B (en) 2017-09-13

Family

ID=57614574

Family Applications (1)

Application Number Title Priority Date Filing Date
GB1617771.9A Active GB2540687B (en) 2014-07-30 2014-07-30 Digital filter

Country Status (1)

Country Link
GB (1) GB2540687B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109116107A (en) * 2018-08-21 2019-01-01 山东中创软件商用中间件股份有限公司 A kind of digital frequency meter
CN110376425A (en) * 2019-06-26 2019-10-25 杭州电子科技大学 A kind of three-phase input signal zero detection circuit
US11057973B2 (en) 2017-08-24 2021-07-06 Signify Holding B.V. Retrofit LED lighting device having improved timing event detection for increasing stable driver operation without light flicker
WO2022148959A1 (en) * 2021-01-06 2022-07-14 Cloudfm Integrated Services Limited Monitoring electrical parameters

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414619B (en) * 2019-08-05 2023-04-07 重庆工商职业学院 EMG signal identification method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3638001A (en) * 1970-03-04 1972-01-25 Hewlett Packard Co Method and apparatus for averaging the digital display for a fluctuating digital measurement and improving the resolution of the measurement
US20120112770A1 (en) * 2008-10-21 2012-05-10 Harald Philipp Signal Processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3638001A (en) * 1970-03-04 1972-01-25 Hewlett Packard Co Method and apparatus for averaging the digital display for a fluctuating digital measurement and improving the resolution of the measurement
US20120112770A1 (en) * 2008-10-21 2012-05-10 Harald Philipp Signal Processing

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11057973B2 (en) 2017-08-24 2021-07-06 Signify Holding B.V. Retrofit LED lighting device having improved timing event detection for increasing stable driver operation without light flicker
CN109116107A (en) * 2018-08-21 2019-01-01 山东中创软件商用中间件股份有限公司 A kind of digital frequency meter
CN110376425A (en) * 2019-06-26 2019-10-25 杭州电子科技大学 A kind of three-phase input signal zero detection circuit
CN110376425B (en) * 2019-06-26 2021-09-14 杭州电子科技大学 Three-phase input signal zero detection circuit
WO2022148959A1 (en) * 2021-01-06 2022-07-14 Cloudfm Integrated Services Limited Monitoring electrical parameters
GB2603110A (en) * 2021-01-06 2022-08-03 Cloudfm Integrated Services Ltd Monitoring electrical parameters
GB2603110B (en) * 2021-01-06 2023-09-27 Cloudfm Integrated Services Ltd Monitoring electrical parameters

Also Published As

Publication number Publication date
GB201617771D0 (en) 2016-12-07
GB2540687B (en) 2017-09-13

Similar Documents

Publication Publication Date Title
GB2534000A (en) Threshold transition detector, RMS measurement and filter
GB2540687A (en) Threshold transition detector, RMS measurement and filter
EP1093680B1 (en) Adaptive sampling rate based on power system frequency
US20060129339A1 (en) Power meter
JP2006250934A (en) Method and device for measuring duty cycle
JP2015527005A5 (en)
CN110568309B (en) Filter, synchronous phasor measurement system and method
CN105738686B (en) A kind of electric current detecting method
JP7441052B2 (en) Effective value calculation device
CN112653465A (en) System and method for removing low frequency offset components from a digital data stream
KR101075484B1 (en) Measurement Device of leakage current ohmic value on power line And Method Thereof
WO2011089421A1 (en) Apparatus and method for measuring a phasor of an electrical power system signal
Patil et al. Robust zero-crossing detection of distorted line voltage using line fitting
EP2639590B1 (en) Wide range, high resolution frequency monitor
JPH07325636A (en) Automatic power factor adjusting device and digital quantity converting method for quantity of alternating-current electricity
EP2839245A1 (en) Method and system for energy efficient measurement of sensor signals
CN105954699B (en) Hall current sensor calibration method
Reza et al. Robust estimation of real-time single-phase grid voltage frequency under distorted conditions
Stepan et al. Implementation of flicker meter in power quality analyzers
Chang et al. A comparative study of voltage flicker envelope estimation methods
KR100964114B1 (en) Apparatus and Method for Phasor Estimation
WO2018198210A1 (en) Abnormal device discrimination device, method, and program
US10309995B2 (en) Method and system for determining phasor components of a periodic waveform
Silva et al. Decaying dc component effect elimination on phasor estimation using an adaptive filtering algorithm
CN115407122A (en) Electric energy metering device and electric energy metering method