C2000Ware Digital Power SDK  5.03.00.00
SPLL_3PH_DDSRF

Introduction

Data Structures

struct  SPLL_3PH_DDSRF_LPF_COEFF
 Defines the coefficients for a loop filter. More...
 
struct  SPLL_3PH_DDSRF
 Defines the SPLL_3PH_DDSRF structure. More...
 

Functions

static void SPLL_3PH_DDSRF_init (float32_t grid_freq, float32_t delta_t, float32_t k1, float32_t k2, SPLL_3PH_DDSRF *spll_obj)
 Initialize SPLL_3PH_DDSRF module. More...
 
static void SPLL_3PH_DDSRF_reset (SPLL_3PH_DDSRF *spll_obj)
 Reset SPLL_3PH_DDSRF module. More...
 
static void SPLL_3PH_DDSRF_run (SPLL_3PH_DDSRF *spll_obj, float32_t d_p, float32_t d_n, float32_t q_p, float32_t q_n)
 Run spll_3PH_srf module. More...
 

Typedefs

typedef float float32_t
 
typedef long double float64_t
 

Macros

#define C2000_IEEE754_TYPES
 

Software Phase Lock Loop based on decoupled double synchronous reference frame for Three Phase Grid (SPLL_3PH_DDSRF) Module

Introduction

The Software Phase Lock Loop based on decoupled double synchronous reference frame (SPLL_3PH_DDSRF) API provides a set of functions that implements a software phase lock loop based on based on decoupled double synchronous reference frame for grid connection to three phase grid.

Software Phase Lock Loop based on DDRF for Model


The grid is subject to varying conditions which result in imbalances in the phase voltages. From the theory of symmetrical components we know that any unbalanced three phase system can be reduced to two symmetrical systems and zero component. The behavior of unbalanced voltages on park and clark transform is analyzed in the section below.

Unbalanced and balanced Three Phase Systems


Now an unbalanced three phase system can be written as summation of balanced three phase systems; one rotating with the sequence of the three phase quantities called the positive sequence and one rotating in the opposite sequence called the negative sequence.


Now resolving the components in the orthogonal axis,


And taking the projections on the rotating reference frame we observe that any negative sequence component appears with twice the frequency on the positive sequence rotating frame axis and vice versa.


This can cause errors in the control loop and estimation of the grid angle and needs to taken into account while designing a phase locked loop for three phase grid connected application.

Hence assuming the instance just before the PLL is locked to the positive vector, the grid voltages can be written as :



Taking the clark transform and ignoring the zero component and the zero sequence


Now taking the park transform using the angle locked by the PLL for the positive sequence:








Hence to get the decoupled value:


The PLL structure is then shown as:


Where the low pass filter transfer function is implemented as follows:

A typical LPF transfer function is given by


In the analog domain, now using bilinear transformation,


Where T is the sampling period the digital low pass filter is run at. Using

\[ T=1/(10Khz)=0.0001 \]

and from the discussion in [1] it is known that

\[\frac{\omega_{f}}{\omega} < \frac{1}{\sqrt{2}} \]

for stable response of the PLL, hence choosing

\[{\omega_{f}}=30 \]

we get

\[ k_{1}=0.00933678, k_{2}=-0.9813264 \]

API Usage

The following is a sequence of steps that can be followed to use the SPLL_3PH_DDSRF API library functions in an existing C program. For a set of code examples that illustrates the use of this library, see the examples in the Digial Power SDK.

Before you can using the library you must add the libraries directory path as a searchable directory in the project include options. This can be done by right-clicking on the project in the Project Explorer window, selecting "Properties". In the window that opens, navigate to "Build, C2000 Compiler, Include Options". In the include path
window, click on the green add directory path button on the right and enter the path to the Digital Power SDK libraries directory.

This allows CCS to search the entire directory for library files.

Once that is done you should follow these steps to incorporate the library into a project:

  1. Specify the include file(s)
    #include "spll_3ph_ddsrf.h"

  2. Create and add module structure to project source file, this is typically in the solution.c file for Digital Power SDK examples Note: In the Digital Power SDK the modules are also externed in the solution.h header file as the module is used by static inline functions defined in the solution.h file.
    extern SPLL_3PH_DDSRF spll_3ph_1;

  3. Initialize module
    SPLL_3ph_DDSRF_init(AC_FREQ_HZ,
    (float32_t)(1.0 / ISR1_FREQUENCY_HZ),
    (float32_t)(0.00188141f),
    (float32_t)(-0.99623717f),
    &spll_3ph_1);
    spll_3ph_1.lpf_coeff.b0 = 333.807f;
    spll_3ph_1.lpf_coeff.b1 = -333.674f;

  4. Using the module
    Note: The run time module is called in the interrupt service routine running at ISR_FREQUENCY by passing the pu value of the measured voltages or currents in pu. The sine and cosine values are also passed to the module, which are typically computed from the PLL angle.
    SPLL_3ph_DDSRF_run(&spll_3ph_1,
    abc_dq0_pos1.d, abc_dq0_neg1.d,
    abc_dq0_pos1.q, abc_dq0_neg1.q);
    grid_angle_radians = spll_3ph_1.theta[1];


API Integration Information

There is only one module in this package, the APIs can be referenced at SPLL_3PH_DDSRF. The module headers are located at spll_3ph_ddsrf.h.

Macro Definition Documentation

◆ C2000_IEEE754_TYPES

#define C2000_IEEE754_TYPES

Definition at line 47 of file spll_3ph_ddsrf.h.

Typedef Documentation

◆ float32_t

typedef float float32_t

Definition at line 52 of file spll_3ph_ddsrf.h.

◆ float64_t

typedef long double float64_t

Definition at line 53 of file spll_3ph_ddsrf.h.

Function Documentation

◆ SPLL_3PH_DDSRF_init()

static void SPLL_3PH_DDSRF_init ( float32_t  grid_freq,
float32_t  delta_t,
float32_t  k1,
float32_t  k2,
SPLL_3PH_DDSRF spll_obj 
)
inlinestatic

Initialize SPLL_3PH_DDSRF module.

Parameters
grid_freqThe grid frequency
delta_t1/Frequency of calling the PLL routine
k1parameter
k2parameter
*spll_objThe SPLL_3PH_DDSRF structure
Returns
None

Definition at line 115 of file spll_3ph_ddsrf.h.

◆ SPLL_3PH_DDSRF_reset()

static void SPLL_3PH_DDSRF_reset ( SPLL_3PH_DDSRF spll_obj)
inlinestatic

Reset SPLL_3PH_DDSRF module.

Parameters
*spll_objThe SPLL_3PH_DDSRF structure
Returns
None

Definition at line 166 of file spll_3ph_ddsrf.h.

◆ SPLL_3PH_DDSRF_run()

static void SPLL_3PH_DDSRF_run ( SPLL_3PH_DDSRF spll_obj,
float32_t  d_p,
float32_t  d_n,
float32_t  q_p,
float32_t  q_n 
)
inlinestatic

Run spll_3PH_srf module.

Parameters
*spll_objThe spll_3PH_ddsrf structure
d_pD Positive seq component of the grid voltage
d_nD Negative seq component of the grid voltage
q_pQ Positive seq component of the grid voltage
q_nQ Negative seq component of the grid voltage
Returns
None

Definition at line 213 of file spll_3ph_ddsrf.h.

SPLL_3PH_DDSRF_LPF_COEFF::b1
float32_t b1
Definition: spll_3ph_ddsrf.h:67
float32_t
float float32_t
Definition: power_meas_sine_analyzer.h:54
spll_3ph_ddsrf.h
ABC_DQ0_POS::d
float32_t d
Output: D axis component (alpha beta -> d,q,z)
Definition: abc_dq0_pos.h:69
ABC_DQ0_NEG::q
float32_t q
Output: Q axis component (alpha beta -> d,q,z)
Definition: abc_dq0_neg.h:71
ABC_DQ0_POS::q
float32_t q
Output: Q axis component (alpha beta -> d,q,z)
Definition: abc_dq0_pos.h:70
ABC_DQ0_NEG::d
float32_t d
Output: D axis component (alpha beta -> d,q,z)
Definition: abc_dq0_neg.h:70
SPLL_3PH_DDSRF::lpf_coeff
SPLL_3PH_DDSRF_LPF_COEFF lpf_coeff
Definition: spll_3ph_ddsrf.h:104
SPLL_3PH_DDSRF
Defines the SPLL_3PH_DDSRF structure.
Definition: spll_3ph_ddsrf.h:78
SPLL_3PH_DDSRF::theta
float32_t theta[2]
Grid phase angle.
Definition: spll_3ph_ddsrf.h:99
SPLL_3PH_DDSRF_LPF_COEFF::b0
float32_t b0
Definition: spll_3ph_ddsrf.h:68