RPIWA - Waveform Access & Continuous Monitoring: Difference between revisions

From lechacal
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 12: Line 12:
* RMS and power related computations.
* RMS and power related computations.
* Continuous monitoring.
* Continuous monitoring.
* Limited Product (only RPIWA_CT7V1 for now).
* Limited Product (only RPIWA_CT7V1 and RPIWA_CT4V3 for now).
* Not stackable.
* Not stackable yet.
* Not stable (we are still working on the software).
* Not stable (we are still working on the software).


Line 20: Line 20:
* No continuous monitoring.
* No continuous monitoring.
* Stable and well established.
* Stable and well established.
* Large range of product.
* Large range of products.
* Stackable.
* Stackable.


Line 26: Line 26:


==Software installation==
==Software installation==
Install the appropriate packages first
sudo apt-get install pigpio python-pigpio python3-pigpio


Get the package and install it
Get the package and install it
Line 45: Line 48:


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.
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.
to read only a given number of data record you can use the command below.
head -100 /tmp/RPIWA.fifo
This read 100 record of data only.


If you prefer doing this with a Python program this is a good start for this below.
If you prefer doing this with a Python program this is a good start for this below.
Line 75: Line 84:


===KCAL===
===KCAL===
This is an array containing the calibration values.  
This is an array containing the calibration values.
 
Some of these theoretical values can be known from [[Gen5_Passive_Component_Setup]].


===RunType===
===RunType===
Line 81: Line 92:
'''0-RAW''' Data are plain RAW data from the ADC. i.e. an integer between 0 and 4095. Format is<br>
'''0-RAW''' Data are plain RAW data from the ADC. i.e. an integer between 0 and 4095. Format is<br>
  Sample raw1 raw2 raw3 raw4 raw5 raw6 raw7 raw8
  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<br>
'''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<br>
  Sample inst1 inst2 inst3 inst4 inst5 inst6 inst7 inst8
  Sample inst1 inst2 inst3 inst4 inst5 inst6 inst7 inst8<br>
Instant is very similar to RAw in the way that it delivers all samples of the waveform.
The difference with Raw is the application of a low pass filter to find the zero of the waveform. Some scaling is also applied using the KCAL values.
 
'''2-CT8''' Output rms data for each channels.Format is<br>
'''2-CT8''' Output rms data for each channels.Format is<br>
  Sample Irms1 Irms2 Irms3 Irms4 Irms5 Irms6 Irms7
  Sample Irms1 Irms2 Irms3 Irms4 Irms5 Irms6 Irms7
'''3-CT7V1''' Compute power of V1 against all other CT for the RPIWA_CT7V1. Format is  
'''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
  Sample Vrms Irms1 Irms2 Irms3 Irms4 Irms5 Irms6 Irms7 P1 P2 P3 P4 P5 P6 P7
Line 91: Line 107:
Does not apply to RunType 0 and 1.  
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.
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.
==Program restart==


Once the configuration file is modified you must now restart the rpiwa service for changes to take effect.
Once the configuration file is modified you must now restart the rpiwa service for changes to take effect.
  sudo systemctl restart rpiwa
  sudo systemctl restart rpiwa
If this command above hangs try the following
sudo killall rpiwa-realtime
sudo systemctl start rpiwa


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

Latest revision as of 13:14, 2 December 2023

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

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 and RPIWA_CT4V3 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.

to read only a given number of data record you can use the command below.

head -100 /tmp/RPIWA.fifo 

This read 100 record of data only.

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.

Some of these theoretical values can be known from Gen5_Passive_Component_Setup.

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

Instant is very similar to RAw in the way that it delivers all samples of the waveform. The difference with Raw is the application of a low pass filter to find the zero of the waveform. Some scaling is also applied using the KCAL values.

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.

Program restart

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

sudo systemctl restart rpiwa

If this command above hangs try the following

sudo killall rpiwa-realtime
sudo systemctl start 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.