This page outlines the key formulae, principles, and concepts forming the mathematical foundations of AC metrology used within LMA.
In metrology, measurements begin at the raw ADC level, where we acquire discretised instantaneous samples of both voltage and current.
Thus, we have: \( v(t) \) and \( i(t) \)
Specifically in the form of ADC samples: \( V_\mathrm{adc_n} \) & \( I_\mathrm{adc_n} \)
These represent the instantaneous voltage and current waveforms.
All subsequent calculations—RMS, power, and energy—are derived directly from these sampled signals.
When analysing AC systems, we are often interested in average quantities.
However, since the average of a pure sine wave over one period is zero, using a simple mean would yield no useful measurement of power or energy.
Instead, we use the Root Mean Square (RMS), which represents an AC systems equivalent DC value.
Mathematically:
\[x_\mathrm{RMS} = \sqrt{ \frac{1}{N} \sum_{n=1}^{N} x_n^2 } \]
This concept forms the foundation of AC metrology.
Using the instantaneous voltage signal \( v(t) \), the RMS value is:
\[V_\mathrm{RMS} = \sqrt{ \frac{1}{T} \int_0^T [v(t)^2] \, dt } \]
In discrete digital form (using ADC samples):
\[V_\mathrm{RMS} = \sqrt{ \frac{1}{N} \sum_{n=1}^{N} [V_\mathrm{adc_n}^2] } \]
Where:
Similarly, for current:
\[I_\mathrm{RMS} = \sqrt{ \frac{1}{T} \int_0^T [i(t)^2] \, dt } \]
Discrete form:
\[I_\mathrm{RMS} = \sqrt{ \frac{1}{N} \sum_{n=1}^{N} [I_\mathrm{adc_n}^2] } \]
Where:
In AC systems, frequency refers to the fundamental line frequency, typically 50 Hz or 60 Hz depending on the region.
Accurate frequency measurement is crucial for power computation, phase determination, and system diagnostics.
A common digital approach is to first filter the voltage signal to isolate the fundamental component and remove high-frequency noise or harmonics, then perform zero-crossing detection on the filtered waveform.
Zero-crossing detection identifies points where the voltage waveform passes through zero in a defined direction (negative-to-positive or positive-to-negative), which serve as time markers of the AC cycle.
In a digital system, the voltage signal is represented by discrete ADC samples, \( V_\mathrm{adc_n} \), where \( n \) indexes the sample.
A zero crossing occurs between samples \( V_\mathrm{adc_n} \) and \( V_\mathrm{adc_{n+1}} \) where the sign of the voltage changes.
The frequency can then be calculated as:
\[f = \frac{1}{N \cdot \delta_t} [Hz] \]
Where:
Power in AC systems is derived directly from voltage and current waveforms defined as:
\[v(t) = V_\mathrm{m} \sin(2 \pi f t) \]
\[i(t) = I_\mathrm{m} \sin(2 \pi f t) \]
Where:
An important topic to cover before going into power computations however is the phase relationship of current and voltage.
Current and voltage are often out of phase due to reactive components (inductors or capacitors).
The angular displacement between them is the phase shift, \( \phi \), a key parameter for determining active and reactive power.
This means we must modify our voltage and current signals to better represent the system:
\[v(t) = V_\mathrm{m} \sin(2 \pi f t) \]
\[i(t) = I_\mathrm{m} \sin(2 \pi f t + \phi) \]
Where \( \phi \) denotes the phase angle:
This is often nicely shown in the form of a phasor diagram.
Apparent power \( S \), measured in \( VoltAmperes [VA] \), represents the total system power (both useful and reactive components):
\[S = V_\mathrm{RMS} I_\mathrm{RMS} \]
Discrete form:
\[S = \frac{1}{N} \sqrt{ \sum_{n=1}^{N} [V_\mathrm{adc_n}^2] \cdot \sum_{n=1}^{N} [I_\mathrm{adc_n}^2] } \]
Active (real) power \( P \), measured in \( Watts [W] \), is the component that performs useful (resistive) work:
\[P = \frac{1}{T} \int_0^T [v(t) i(t)] dt \]
Discrete form:
\[P = \frac{1}{N} \sum_{n=1}^{N} [V_\mathrm{adc_n} I_\mathrm{adc_n}] \]
Reactive (imaginary) power \( Q \), measured in \( VoltAmperesReactive [VAR] \), is the component that performs no net work in the system.
It represents energy exchanged with inductive or capacitive components.
We can understand reactive power by recalling three key points about phase relationships:
From this, we can derive an important concept, if we artificially shift the current waveform by 90°, the resulting active power becomes zero, leaving only the reactive component.
Therefore mathematically introducing a 90° shift in current gives:
\[ q(t) = v(t) \cdot i(t - 90^\circ) = V_\mathrm{pk} \sin(2 \pi f t) \cdot I_\mathrm{pk} \sin(2 \pi f t + \phi - 90^\circ) \]
Discrete form:
\[ Q = \frac{1}{N} \sum_{n=1}^{N} [V_\mathrm{adc_n} \cdot I_\mathrm{adc_n-90^\circ}] \]
Where:
The Power Factor (PF) expresses how efficiently power is used and is defined as:
\[\mathrm{PF} = \cos(\phi) \]
Thus:
The easiest way to compute the power factor is using apparent and active power:
\[\mathrm{PF} = \cos(\phi) = \frac{S}{P} \]
Energy is the cumulative measure of total work done or power consumed by a system over time.
In AC metrology, we do not compute energy directly from voltage and current samples; instead, we build on previously defined power computations.
Energy computation flow:
Instantaneous power is defined as:
\[ p(t) = v(t) \cdot i(t) \]
And energy is the integral of power over time:
\[ E = \int_0^T p(t) \, dt \]
In a discrete digital system, we process data in finite computation windows of samples ( \( N \)).
This means energy per unit time becomes:
\[ E = P \cdot \delta \]
In a system with a fixed sampling period \( \delta \) becomes \( \frac{1}{f_s} \) and an energy quanta per sampling period can be defined:
\[ E_\mathrm{unit} = \frac{P}{f_s} \]
Where:
And we can use this quanta by incrementing a running total of energy every time a sampling period passes:
\[ E_\mathrm{t} = E_\mathrm{t,prev} + E_\mathrm{unit} \]
Where:
The table below summarises the computation of energy per sampling period (unit) and accumulated totals for active, reactive, and apparent power.
Type | Instantaneous Power | Average Power | Energy Unit | Accumulated Energy Total | Units |
---|---|---|---|---|---|
Active | \( p(t) = v(t) \cdot i(t) \) | \( P = \frac{1}{N} \sum_{n=1}^{N} [V_\mathrm{adc_n} \cdot I_\mathrm{adc_n}] \) | \( E_\mathrm{active,unit} = \frac{P}{f_s} \) | \( E_\mathrm{active,t} = E_\mathrm{active,t,prev} + E_\mathrm{active,unit} \) | Ws |
Reactive | \( q(t) = v(t) \cdot i(t - 90^\circ) \) | \( Q = \frac{1}{N} \sum_{n=1}^{N} [V_\mathrm{adc_n} \cdot I_\mathrm{adc_n-90^\circ}] \) | \( E_\mathrm{reactive,unit} = \frac{Q}{f_s} \) | \( E_\mathrm{reactive,t} = E_\mathrm{reactive,t,prev} + E_\mathrm{reactive,unit} \) | VARs |
Apparent | Not Applicable | \( S = \frac{1}{N} \sqrt{\sum_{n=1}^{N} V_\mathrm{adc_n}^2 \cdot \sum_{n=1}^{N} I_\mathrm{adc_n}^2} \) | \( E_\mathrm{apparent,unit} = \frac{S}{f_s} \) | \( E_\mathrm{apparent,t} = E_\mathrm{apparent,t,prev} + E_\mathrm{apparent,unit} \) | VAs |
Where:
This table provides a compact overview of how each type of energy is calculated per computation window and accumulated over time, including their respective units.
Where:
To summarise, energy accumulation follows this loop:
Filtering is an essential part of digital metrology, removing DC bias, noise, and high-frequency components.
A High-Pass Filter (HPF) attenuates low frequencies (including DC). Its cutoff frequency, \( f_c \), defines where attenuation begins (–3 dB point).
\[y_n = \alpha y_{n-1} + \alpha (x_n - x_{n-1}) \]
\[\alpha = \frac{1}{1 + 2 \pi f_c T_s} \]
Where:
Used in LMA’s ADC front-end to eliminate DC offsets from amplifiers.
A Low-Pass Filter (LPF) attenuates high-frequencies. Its cutoff frequency, \( f_c \), defines where attenuation begins (–3 dB point).
\[y_n = \alpha x_n + (1 - \alpha) y_{n-1} \]
\[\alpha = \frac{2 \pi f_c T_s}{1 + 2 \pi f_c T_s} \]
Where:
LPFs in LMA are used in zero-crossing detection and frequency measurement, and also as hardware anti-aliasing filters.