« Close

Datasheets and User Guides

App Notes

Software & Driver

 

14.1.4 RMS

Overview

AIN#_EF_INDEX values:

  • 10: RMS Flex
  • 11: RMS Auto

This RMS Extended Feature calculates the true root mean square voltage of a signal connected to an analog input. It also calculates peak-to-peak voltage, DC offset (average voltage), and period (1/frequency) of the analog waveform.

RMS Flex: RMS Flex uses registers to specify the number of samples to collect and the frequency at which to collect those samples. The LabJack will then use the entire data set to calculate RMS.

RMS Auto: RMS Auto will collect samples for more than one period and attempt to find a period within the data set. The LabJack will then compute RMS for only the detected period's period.

Configuration

To configure, write to the following registers.

AIN#_EF_CONFIG_A - Number of Samples: The number of samples to be acquired.

  • Default: 200
  • Max: 16384

AIN#_EF_CONFIG_B - Hysteresis (RMS Auto only): The smallest step (analog voltage in binary) that will trigger period detection when using RMS Auto. Larger values will better reject noise. Smaller values can increase the accuracy of the period calculation.

  • Default: 100 (16-bit counts)
  • This value is meaningless for RMS Flex

AIN#_EF_CONFIG_D - Scan Rate: The frequency at which samples will be collected.

  • Default: 6000

Sample Time

The maximum possible sample time is 180 ms.

Sample time is the number of samples divided by the sample frequency. For example, the period is 16.7 ms when using a scan rate of 6000 Hz and 100 samples:

100 samples / 6000 samples per second = 16.7 ms


RMS Flex Considerations

RMS Flex requires the sample time to be an even number of periods.

RMS Auto Considerations

RMS Auto requires the sample time to be set so that 1.5 to 4 periods will be observed.

The hysteresis value also needs to be set to control the sensitivity of period detection.

Accuracy

Stream-burst is used to acquire the specified number of samples at hardware timed intervals. The true RMS is then calculated using the following piece-wise math:

( (Σ(each sample^2)) / number of samples ) ^0.5

The accuracy of this calculation depends on the number of samples per cycle. Smooth waveforms will not require many samples per cycle, but waveforms with lots of harmonic content will require more samples per cycle.

Stream Configuration

This extended feature internally uses Stream-Burst to acquire the data set, so stream AIN configurations apply.

Results

For results, read the following registers.

AIN#_EF_READ_A: RMS Voltage
AIN#_EF_READ_B: Peak-to-Peak Voltage
AIN#_EF_READ_C: DC Offset Voltage (Average)
AIN#_EF_READ_D: Period (Seconds)

Only reading AIN#_EF_READ_A triggers a new measurement. Because multiple measurements are taken, a read of AIN#_EF_READ_A blocks for the length of the sample time.

2 comments

dbinger's picture

Please add an explanation of the Hysteresis CONFIG_B value.

LabJack Support's picture

Updated the description for Hysteresis.