C2000Ware Digital Power SDK  5.03.00.00
abc_dq0_pos.h
Go to the documentation of this file.
1 //#############################################################################
2 //
3 // FILE: abc_dq0_pos.h
4 //
5 // TITLE: ABC to DQ0 Positive Sequence Transform Module
6 //
7 //#############################################################################
8 // $TI Release: C2000Ware DigitalPower SDK v5.03.00.00 $
9 // $Release Date: Mon Aug 12 12:17:45 CDT 2024 $
10 // $Copyright:
11 // Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
12 //
13 // ALL RIGHTS RESERVED
14 // $
15 //#############################################################################
16 
17 #ifndef ABC_DQ0_POS_H
18 #define ABC_DQ0_POS_H
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 //*****************************************************************************
25 //
28 //
29 //*****************************************************************************
30 
31 //
32 // Included Files
33 //
34 #include <stdint.h>
35 #ifndef __TMS320C28XX_CLA__
36 #include <math.h>
37 #else
38 #include <CLAmath.h>
39 #endif
40 
41 //#############################################################################
42 //
43 // Macro Definitions
44 //
45 //#############################################################################
46 #ifndef C2000_IEEE754_TYPES
47 #define C2000_IEEE754_TYPES
48 #ifdef __TI_EABI__
49 typedef float float32_t;
50 typedef double float64_t;
51 #else // TI COFF
52 typedef float float32_t;
53 typedef long double float64_t;
54 #endif // __TI_EABI__
55 #endif // C2000_IEEE754_TYPES
56 
57 //
58 // Typedefs
59 //
60 
66 typedef struct{
73 
78 static inline void ABC_DQ0_POS_reset(ABC_DQ0_POS *v)
79 {
80  v->alpha = 0;
81  v->beta = 0;
82  v->d = 0;
83  v->q = 0;
84  v->z = 0;
85 }
86 
96 static inline void ABC_DQ0_POS_run(ABC_DQ0_POS *v,
98  float32_t sine_val, float32_t cosine_val)
99 {
100  v->alpha = (0.66666666677f) * (a - 0.5f * (b + c));
101  v->beta = (0.57735026913f) * (b - c);
102  v->z = (0.57735026913f) * (a + b + c);
103  v->d = v->alpha * cosine_val + v->beta * sine_val;
104  v->q = -v->alpha * sine_val + v->beta * cosine_val;
105 }
106 
107 //*****************************************************************************
108 //
109 // Close the Doxygen group.
111 //
112 //*****************************************************************************
113 
114 #ifdef __cplusplus
115 }
116 #endif // extern "C"
117 
118 #endif // end of _ABC_DQ0_POS_H_ definition
119 
120 //
121 // End of File
122 //
ABC_DQ0_POS_run
static void ABC_DQ0_POS_run(ABC_DQ0_POS *v, float32_t a, float32_t b, float32_t c, float32_t sine_val, float32_t cosine_val)
Run ABC_DQ0_POS routine.
Definition: abc_dq0_pos.h:96
ABC_DQ0_POS
Defines the ABC_DQ0_POS transform structure.
Definition: abc_dq0_pos.h:66
ABC_DQ0_POS::z
float32_t z
Output: Z axis component (alpha beta -> d,q,z)
Definition: abc_dq0_pos.h:71
float32_t
float float32_t
Definition: power_meas_sine_analyzer.h:54
ABC_DQ0_POS::d
float32_t d
Output: D axis component (alpha beta -> d,q,z)
Definition: abc_dq0_pos.h:69
ABC_DQ0_POS::q
float32_t q
Output: Q axis component (alpha beta -> d,q,z)
Definition: abc_dq0_pos.h:70
float64_t
long double float64_t
Definition: abc_dq0_pos.h:53
float32_t
float float32_t
Definition: abc_dq0_pos.h:52
ABC_DQ0_POS::alpha
float32_t alpha
Output: Alpha component (abc-> alpha beta)
Definition: abc_dq0_pos.h:67
ABC_DQ0_POS_reset
static void ABC_DQ0_POS_reset(ABC_DQ0_POS *v)
Resets internal data to zero.
Definition: abc_dq0_pos.h:78
ABC_DQ0_POS::beta
float32_t beta
Output: Beta component (abc-> alpha beta)
Definition: abc_dq0_pos.h:68