RPIWA - Waveform Access & Continuous Monitoring

From lechacal
Jump to: navigation, search

This product is under development. For stable products please refer to our RPICT range instead

IMG 0699 small.png

RPIWA range aims to provide the same functionalities as RPICT range which is to compute RMS values and power related values at regular intervals. The bonus with RPIWA is the possibility to directly access the raw data. A developer can now perform his own RMS / power computations if desired. Or maybe plot the fft in real time. Or anything else you invented. A great benefit is the ability to perform continuous monitoring as the waveform sampling is now uninterrupted.

Let's compare RPICT and RPIWA in the current state.

RPIWA

  • RMS and power related computations.
  • Continuous monitoring.
  • Limited Product (only RPIWA_CT7V1 for now).
  • Not stackable yet.
  • Not stable (we are still working on the software).

RPICT

  • RMS and power related computations.
  • No continuous monitoring.
  • Stable and well established.
  • Large range of products.
  • Stackable.

If you are acquiring our product for the first time we recommend starting with RPICT units instead here.

Software installation

Install the appropriate packages first

sudo apt-get install pigpio python-pigpio python3-pigpio

Get the package and install it

wget http://lechacal.com/RPIWA/rpiwa-realtime-v1.0.0_armhf.deb
sudo dpkg -i  rpiwa-realtime-v1.0.0_armhf.deb

Reading the data

Data are made available from a fifo located in /tmp/RPIWA.fifo. You can access the data with a simple cat command.

cat /tmp/RPIWA.fifo

An example of the output is shown below.

479169 -191.791 -0.009 -0.010 -0.009 -0.010 -0.017 -0.011 -0.025
479170 -223.441 -0.009 0.064 0.065 -0.010 -0.017 -0.011 -0.025
479171 -253.859 -0.009 -0.010 -0.009 -0.010 -0.017 -0.011 -0.025
479172 -277.439 -0.009 -0.010 -0.009 -0.010 -0.017 0.063 0.049
479173 -297.191 -0.009 -0.010 -0.009 -0.010 -0.017 -0.011 -0.025
479174 -312.319 0.065 -0.010 -0.009 -0.010 -0.017 0.063 0.049

The format normally depends on what is configured. In this instance the first field is the sample number followed by the instant value in Volts or Ampere for each channels.

If you prefer doing this with a Python program this is a good start for this below.

 with open("/tmp/RPIWA.fifo") as f:
    while True:
        line = f.readline()
        if not line:
            break
        print(line, end = "")

Configuration

The configuration is /etc/rpiwa.conf

sudo nano /etc/rpiwa.conf

This is the content of the file:

# Calibration Values
KCAL = 200.43 74.074 74.074 74.074 74.074 74.074 74.074 74.074

# OutputRate in milliseconds
# Only valid for Output types CT8 and CT7V1
OutputRate = 1000

# RunType
# 0-RAW 1-Instant 2-CT8 3-CT7V1
RunType = 1

KCAL

This is an array containing the calibration values.

RunType

This defines the output types that should apply. Enter a number between 0 and 3.
0-RAW Data are plain RAW data from the ADC. i.e. an integer between 0 and 4095. Format is

Sample raw1 raw2 raw3 raw4 raw5 raw6 raw7 raw8

1-Instant This is similar to raw but data are centred and scaled to physical value. Values are either representing actual voltage or amperage. Format is

Sample inst1 inst2 inst3 inst4 inst5 inst6 inst7 inst8

2-CT8 Output rms data for each channels.Format is

Sample Irms1 Irms2 Irms3 Irms4 Irms5 Irms6 Irms7

3-CT7V1 Compute power of V1 against all other CT for the RPIWA_CT7V1. Format is

Sample Vrms Irms1 Irms2 Irms3 Irms4 Irms5 Irms6 Irms7 P1 P2 P3 P4 P5 P6 P7

OutputRate

Does not apply to RunType 0 and 1. Determine how often data comes out for all channels at one time. This is set in milliseconds. Minimum acceptable is 0.32ms. Must be a multiple of 0.32.

Once the configuration file is modified you must now restart the rpiwa service for changes to take effect.

sudo systemctl restart rpiwa

Stacking

There is no stacking support at the moment. Although we plan to implement single board staking at some point with a CT8 unit.