You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
6.2 KiB
C++

/*
* SymmetricalComponents.h
*
* Author: Aleksey Gerasimenko
* gerasimenko.aleksey.n@gmail.com
*/
#include <math.h>
#include <stdint.h>
#include "SYSCTRL/RelativeAnalogSignalStructure.h"
#ifndef SYSCTRL_SYMMETRICALCOMPONENTS_H_
#define SYSCTRL_SYMMETRICALCOMPONENTS_H_
namespace SYSCTRL
{
struct SymmetricalComponentsPhaseProjection
{
float active;
float reactive;
SymmetricalComponentsPhaseProjection():
active(FP_ZERO),
reactive(FP_ZERO)
{}
};//SymmetricalComponentsPhaseProjection
struct SymmetricalComponentsPhase
{
SymmetricalComponentsPhaseProjection a;
SymmetricalComponentsPhaseProjection b;
SymmetricalComponentsPhaseProjection c;
SymmetricalComponentsPhase():
a(),
b(),
c()
{}
//
};//SymmetricalComponentsPhase
struct SymmetricalComponentsStructure
{
SymmetricalComponentsPhase direct;
SymmetricalComponentsPhase inverse;
SymmetricalComponentsPhase zero;
SymmetricalComponentsStructure():
direct(),
inverse(),
zero()
{}
//
};//SymmetricalComponentsStructure
class SymmetricalComponents
{
private:
static const float m_coefficient_a = 0.5;
static const float m_coefficient_b = 0.8660254;
static const float m_three_recipcoral = 0.33333333;
public:
SymmetricalComponents();
public:
static void compute_symmetrical_components_axis_common(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsStructure& out);
static void compute_direct_symmetrical_components_axis_common(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
static void compute_inverse_symmetrical_components_axis_common(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
static void compute_zero_symmetrical_components_axis_common(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
static void compute_symmetrical_components_axis_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsStructure& out);
static void compute_direct_symmetrical_components_axis_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
static void compute_inverse_symmetrical_components_axis_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
static void compute_zero_symmetrical_components_axis_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
private:
inline static void _direct_common_inverse_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
inline static void _inverse_common_zero_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
inline static void _zero_common_direct_own(const SYSCTRL::ProjectionAnalogSignalStructure in_ph_a,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_b,
const SYSCTRL::ProjectionAnalogSignalStructure in_ph_c,
SYSCTRL::SymmetricalComponentsPhase& out);
//
};//SymmetricalComponents
} /* namespace SYSCTRL */
#endif /* SYSCTRL_SYMMETRICALCOMPONENTS_H_ */