MycilaJSY 13.0.0
Arduino / ESP32 library for the JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333 families single-phase and three-phase AC bidirectional meters from Shenzhen Jiansiyan Technologies Co, Ltd.
Loading...
Searching...
No Matches
Mycila::JSY::Metrics Class Reference

Public Member Functions

float thdi (float phi=0) const
 Compute the total harmonic distortion percentage of current (THDi). This assumes THDu = 0 (perfect voltage sin wave). See: https://fr.electrical-installation.org/frwiki/Indicateur_de_distorsion_harmonique_:_facteur_de_puissance.
 
float resistance () const
 Compute the resistance of the load in ohms (R = P / I^2).
 
float dimmedVoltage () const
 Compute the dimmed voltage (V = P / I).
 
float nominalPower () const
 Compute the nominal power of the load in watts (P = V^2 / R).
 
void clear ()
 
bool operator== (const Metrics &other) const
 
bool operator!= (const Metrics &other) const
 
Metricsoperator+= (const Metrics &other)
 
void operator= (const Metrics &other)
 

Data Fields

float frequency = NAN
 Frequency in hertz (Hz).
 
float voltage = NAN
 Voltage in volts (V).
 
float current = NAN
 Current in amperes (A).
 
float activePower = NAN
 Active power in watts (W). Can be positive or negative.
 
float powerFactor = NAN
 Power factor. Positive value between 0 and 1.
 
float apparentPower = NAN
 Apparent power in volt-amperes (VA). Always positive.
 
float reactivePower = NAN
 Reactive power in volt-amperes reactive (VAr). Can be positive or negative.
 
uint32_t activeEnergy = 0
 Active energy in watt-hours (Wh).
 
uint32_t activeEnergyImported = 0
 Active energy imported in watt-hours (Wh), going to the load, when activePower > 0.
 
uint32_t activeEnergyReturned = 0
 Active energy returned in watt-hours (Wh), coming from the load, when activePower < 0.
 
uint32_t reactiveEnergy = 0
 Reactive energy in volt-amperes reactive-hours (VArh).
 
uint32_t reactiveEnergyImported = 0
 Reactive energy imported in volt-amperes reactive-hours (VArh), going to the load, when reactivePower > 0.
 
uint32_t reactiveEnergyReturned = 0
 Reactive energy returned in volt-amperes reactive-hours (VArh), coming from the load, when reactivePower < 0.
 
uint32_t apparentEnergy = 0
 Apparent energy in volt-amperes-hours (VAh).
 
float phaseAngleU = NAN
 voltage phase angle in degrees (°).
 
float phaseAngleI = NAN
 current phase angle in degrees (°).
 
float phaseAngleUI = NAN
 voltage - current phase angle displacement in degrees (°).
 
float thdU = NAN
 total harmonic distortion of voltage (THDu), as a percentage (%).
 
float thdI = NAN
 total harmonic distortion of current (THDi) as a percentage (%).
 

Detailed Description

Definition at line 125 of file MycilaJSY.h.

Member Function Documentation

◆ clear()

void Mycila::JSY::Metrics::clear ( )

Definition at line 22 of file MycilaJSYMetrics.cpp.

◆ dimmedVoltage()

float Mycila::JSY::Metrics::dimmedVoltage ( ) const

Compute the dimmed voltage (V = P / I).

Note
The dimmed voltage is the voltage that would be measured at the output of a TRIAC, SSR or voltage regulator device.

Definition at line 18 of file MycilaJSYMetrics.cpp.

◆ nominalPower()

float Mycila::JSY::Metrics::nominalPower ( ) const

Compute the nominal power of the load in watts (P = V^2 / R).

Note
The voltage is the nominal voltage measured by the JSY and R is the measured resistance of the load, which can be regulated by a TRIAC, SSR or voltage regulator.

Definition at line 20 of file MycilaJSYMetrics.cpp.

◆ operator!=()

bool Mycila::JSY::Metrics::operator!= ( const Metrics & other) const
inline

Definition at line 280 of file MycilaJSY.h.

◆ operator+=()

Mycila::JSY::Metrics & Mycila::JSY::Metrics::operator+= ( const Metrics & other)

Definition at line 66 of file MycilaJSYMetrics.cpp.

◆ operator=()

void Mycila::JSY::Metrics::operator= ( const Metrics & other)

Definition at line 83 of file MycilaJSYMetrics.cpp.

◆ operator==()

bool Mycila::JSY::Metrics::operator== ( const Metrics & other) const

Definition at line 44 of file MycilaJSYMetrics.cpp.

◆ resistance()

float Mycila::JSY::Metrics::resistance ( ) const

Compute the resistance of the load in ohms (R = P / I^2).

Definition at line 16 of file MycilaJSYMetrics.cpp.

◆ thdi()

float Mycila::JSY::Metrics::thdi ( float phi = 0) const

Compute the total harmonic distortion percentage of current (THDi). This assumes THDu = 0 (perfect voltage sin wave). See: https://fr.electrical-installation.org/frwiki/Indicateur_de_distorsion_harmonique_:_facteur_de_puissance.

Parameters
phiThe phase shift angle in degrees (°) (0 for resistive load)
Returns
The total harmonic distortion of current (THDi) as a percentage (%)

Definition at line 9 of file MycilaJSYMetrics.cpp.

Field Documentation

◆ activeEnergy

uint32_t Mycila::JSY::Metrics::activeEnergy = 0

Active energy in watt-hours (Wh).

Note
JSY1031, JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
JSY-MK-163, JSY-MK-193, JSY-MK-194: computed, sum of activeEnergyImported and activeEnergyReturned

Definition at line 176 of file MycilaJSY.h.

◆ activeEnergyImported

uint32_t Mycila::JSY::Metrics::activeEnergyImported = 0

Active energy imported in watt-hours (Wh), going to the load, when activePower > 0.

Note
JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
: For DC boards, matches the positive energy

Definition at line 183 of file MycilaJSY.h.

◆ activeEnergyReturned

uint32_t Mycila::JSY::Metrics::activeEnergyReturned = 0

Active energy returned in watt-hours (Wh), coming from the load, when activePower < 0.

Note
JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
: For DC boards, matches the negative energy

Definition at line 190 of file MycilaJSY.h.

◆ activePower

float Mycila::JSY::Metrics::activePower = NAN

Active power in watts (W). Can be positive or negative.

Note
JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333

Definition at line 149 of file MycilaJSY.h.

◆ apparentEnergy

uint32_t Mycila::JSY::Metrics::apparentEnergy = 0

Apparent energy in volt-amperes-hours (VAh).

Note
JSY-MK-333: measured

Definition at line 216 of file MycilaJSY.h.

◆ apparentPower

float Mycila::JSY::Metrics::apparentPower = NAN

Apparent power in volt-amperes (VA). Always positive.

Note
JSY1031, JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
JSY-MK-163, JSY-MK-193, JSY-MK-194: computed

Definition at line 162 of file MycilaJSY.h.

◆ current

float Mycila::JSY::Metrics::current = NAN

Current in amperes (A).

Note
JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333

Definition at line 143 of file MycilaJSY.h.

◆ frequency

float Mycila::JSY::Metrics::frequency = NAN

Frequency in hertz (Hz).

Note
JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333

Definition at line 131 of file MycilaJSY.h.

◆ phaseAngleI

float Mycila::JSY::Metrics::phaseAngleI = NAN

current phase angle in degrees (°).

Note
JSY-MK-333: measured

Definition at line 228 of file MycilaJSY.h.

◆ phaseAngleU

float Mycila::JSY::Metrics::phaseAngleU = NAN

voltage phase angle in degrees (°).

Note
JSY-MK-333: measured

Definition at line 222 of file MycilaJSY.h.

◆ phaseAngleUI

float Mycila::JSY::Metrics::phaseAngleUI = NAN

voltage - current phase angle displacement in degrees (°).

Note
JSY-MK-333: measured

Definition at line 234 of file MycilaJSY.h.

◆ powerFactor

float Mycila::JSY::Metrics::powerFactor = NAN

Power factor. Positive value between 0 and 1.

Note
JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333

Definition at line 155 of file MycilaJSY.h.

◆ reactiveEnergy

uint32_t Mycila::JSY::Metrics::reactiveEnergy = 0

Reactive energy in volt-amperes reactive-hours (VArh).

Note
JSY-MK-227, JSY-MK-229, JSY-MK-333: measured

Definition at line 196 of file MycilaJSY.h.

◆ reactiveEnergyImported

uint32_t Mycila::JSY::Metrics::reactiveEnergyImported = 0

Reactive energy imported in volt-amperes reactive-hours (VArh), going to the load, when reactivePower > 0.

Note
JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
: For DC boards, matches the positive energy

Definition at line 203 of file MycilaJSY.h.

◆ reactiveEnergyReturned

uint32_t Mycila::JSY::Metrics::reactiveEnergyReturned = 0

Reactive energy returned in volt-amperes reactive-hours (VArh), coming from the load, when reactivePower < 0.

Note
JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
: For DC boards, matches the negative energy

Definition at line 210 of file MycilaJSY.h.

◆ reactivePower

float Mycila::JSY::Metrics::reactivePower = NAN

Reactive power in volt-amperes reactive (VAr). Can be positive or negative.

Note
JSY1031, JSY-MK-227, JSY-MK-229, JSY-MK-333: measured
JSY-MK-163, JSY-MK-193, JSY-MK-194: computed and always be positive since we do not know the phase shift angle (inductive or capacitive load)

Definition at line 169 of file MycilaJSY.h.

◆ thdI

float Mycila::JSY::Metrics::thdI = NAN

total harmonic distortion of current (THDi) as a percentage (%).

Note
JSY-MK-333: measured

Definition at line 246 of file MycilaJSY.h.

◆ thdU

float Mycila::JSY::Metrics::thdU = NAN

total harmonic distortion of voltage (THDu), as a percentage (%).

Note
JSY-MK-333: measured

Definition at line 240 of file MycilaJSY.h.

◆ voltage

float Mycila::JSY::Metrics::voltage = NAN

Voltage in volts (V).

Note
JSY1031, JSY-MK-163, JSY-MK-193, JSY-MK-194, JSY-MK-227, JSY-MK-229, JSY-MK-333

Definition at line 137 of file MycilaJSY.h.


The documentation for this class was generated from the following files: