This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIDA-01606: Questions about TIDA-01606

Part Number: TIDA-01606


Tool/software:

Hi Expert,

Recently, my customer is studying the phase locking program, so I would like to ask some questions while referring to the TIDA-01606 program.

1. Is the red box in Figure 1 an error in the drawing, because it should be the inverter current in common sense, or is it because the grid current of TIDA-01606 is almost the same as the inverter when connected to the grid in inverter mode. The two interchanges are Is there any problem? In the program, the inverter current command is used, as shown in Figure 2.

2. The red line in Figure 1 should be marked right? The value read by the ADC should be converted to the omega of the DQ axis after scaling, and the angular velocity output by the SPLL should be used, right?

3. If the TINV_DC_CHECK in the blue box in Figure 1 is 1, what signal is it to confirm? Because I see that the program is placed in the user setting. If it is set to 1, it will directly output a fixed angular frequency to the entire system, so I I think the direction of the relay should be reversed. But I still don’t understand what signal we need to confirm after outputting the fixed angular frequency to the system?

Figure 1

Figure 2

Best Regards,

Seamus

  • Hi Seamus,

    following you can find the answers:

    1) code can be configure by controlling the current of the grid or the current of the switching node. Currently, it is recommended to control the current of the grid which is based on SDFM because it is a much cleaner measurement.

    2) it is wrong to connect the output of these four transformation in parallel. We have 4 set of three phase measurements grid current, grid voltage, switching node current, swithcing node voltage. The PLL is using only the output value coming out from the grid voltage.

    3) I believe that variable is coming out when you need to run in open loop the reference design. Basically, when no grid is connected you need to generate internally an angle to create the 50 Hz signals.

    Thanks

    BR

    Riccardo

  • Hi Riccardo,

    Regarding the 2) , my question is that the sin and cos of the four DQ conversions on the right side of Figure 1 all come from TINV_Sine and TINV_Cose, right?

    The function I want to implement is also very simple. I just want to read the three-phase voltage of the input mains and use DDSRF to calculate the phase of the mains, and provide it to the UPS inverter for phase locking.

    Figure 2 is the flow of my experimental program

    1. Use the Rampgen in Figure 3 to generate a three-phase ABC analog input signal (pretend to be the standard ADC signal)
    2. Do positive and negative conversion of DQ in Timer 0 of 19.2k
    3. Send the positive and negative converted data to the DDSRF module
    4. Output the PLL angle of DDSRF output TINV_angleSPLL_radians
    5. Send the angles TINV_angle_radians and TINV_angleSPLL_radians output by Rampgeng to the DAC for easy viewing by the oscillator.
    Note: All structure initialization is in accordance with the initialization settings of TIDA-01606.

    Figures 3, 4 and 5 are program descriptions and oscilloscope screenshots. Judging from the oscilloscope screenshots, it may actually be locked, but the locked position seems weird.
    Is it because I didn’t adjust the LOW PASS of DDSRF?

    Figure 1

    Figure 2

    Figure 3

    Figure 4

    Figure 5

    //#############################################################################
    //
    // FILE:   empty_driverlib_main.c
    //
    // TITLE:  Empty Project
    //
    // Empty Project Example
    //
    // This example is an empty project setup for Driverlib development.
    //
    //#############################################################################
    //
    //
    // $Copyright:
    // Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    #include "c2000ware_libraries.h"
    #include "math.h"
    
    #include "rampgen.h"
    #include "abc_dq0_neg.h"
    #include "abc_dq0_pos.h"
    #include "dq0_abc.h"
    #include "spll_3ph_ddsrf.h"
    #include "spll_3ph_srf.h"
    
    #define TINV_PI                 ((float32_t)3.141592653589)
    #define TINV_ISR1_FREQUENCY_HZ  19200
    #define TINV_AC_FREQ_HZ         ((float32_t)60)
    #define TWO_PI                  6.2831853
    
    RAMPGEN TINV_rgen;
    
    ABC_DQ0_POS TINV_vGrid_dq0_pos;
    ABC_DQ0_NEG TINV_vGrid_dq0_neg;
    
    DQ0_ABC TINV_vInv_dq0;
    SPLL_3PH_DDSRF TINV_spll_3ph_1;
    
    volatile float32_t TINV_angle_radians;
    float32_t TINV_angleSPLL_radians = 0;
    float32_t TINV_sine_A;
    float32_t TINV_sine_B;
    float32_t TINV_sine_C;
    float32_t TINV_cosine_A;
    float32_t TINV_cosine_B;
    float32_t TINV_cosine_C;
    float32_t TINV_sine;
    float32_t TINV_cosine;
    
    float32_t TINV_vGrid_A_sensed_pu;
    float32_t TINV_vGrid_B_sensed_pu;
    float32_t TINV_vGrid_C_sensed_pu;
    
    float32_t theta = 0;
    float32_t GoalF = 60;
    void TINV_runTransformOnSensedSignals(void);
    void TINV_generateInternalReference(void);
    void TINV_runSPLL(float32_t v_p_d, float32_t v_n_d,float32_t v_p_q, float32_t v_n_q);
    void theta_generator(float *baseTheta);
    //
    // Main
    //
    void main(void)
    {
    
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Disable pin locks and enable internal pull-ups.
        //
        Device_initGPIO();
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // PinMux and Peripheral Initialization
        //
        Board_init();
        //
        // C2000Ware Library initialization
        //
        C2000Ware_libraries_init();
        //
        // RAMPGEN initialization
        //
        RAMPGEN_reset(&TINV_rgen);
        RAMPGEN_config(&TINV_rgen,
                       TINV_ISR1_FREQUENCY_HZ,
                       TINV_AC_FREQ_HZ);
    
        // DQ transform initialization
        ABC_DQ0_POS_reset(&TINV_vGrid_dq0_pos);
        ABC_DQ0_NEG_reset(&TINV_vGrid_dq0_neg);
    
        // SPLL initialization
        SPLL_3PH_DDSRF_init(TINV_AC_FREQ_HZ,
                            (float32_t)(1.0 / TINV_ISR1_FREQUENCY_HZ),
                            (float32_t)(0.00188141f),
                            (float32_t)(-0.99623717f),
                            &TINV_spll_3ph_1);
    
        TINV_spll_3ph_1.lpf_coeff.b0 = 333.807f;
        TINV_spll_3ph_1.lpf_coeff.b1 = -333.674f;
    
        //
        // Enable Global Interrupt (INTM) and real time interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        while(1)
        {
            
        }
    }
    
    uint16_t DACA_Out;
    uint16_t DACC_Out;
    
    __interrupt void cpuTimer0ISR(void)
    {
        ABC_DQ0_POS_run(&TINV_vGrid_dq0_pos,
                TINV_vGrid_A_sensed_pu,
                TINV_vGrid_B_sensed_pu,
                TINV_vGrid_C_sensed_pu,
                TINV_sine, TINV_cosine);
    
        ABC_DQ0_NEG_run(&TINV_vGrid_dq0_neg,
                TINV_vGrid_A_sensed_pu,
                TINV_vGrid_B_sensed_pu,
                TINV_vGrid_C_sensed_pu,
                TINV_sine, TINV_cosine);
    
        TINV_runSPLL(TINV_vGrid_dq0_pos.d,
                    TINV_vGrid_dq0_neg.d,
                    TINV_vGrid_dq0_pos.q,
                    TINV_vGrid_dq0_neg.q);
    
        TINV_sine = sinf(TINV_angleSPLL_radians);
        TINV_cosine = cosf(TINV_angleSPLL_radians);
    
        //DACA_Out = (uint16_t)((float)theta * 650);
        DACA_Out = (uint16_t)((float)TINV_angle_radians * 650);
        DACC_Out = (uint16_t)((float)TINV_angleSPLL_radians * 650);
    
        DAC_setShadowValue(DAC_A_BASE,DACA_Out);
        DAC_setShadowValue(DAC_C_BASE,DACC_Out);
    
    
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    }
    
    uint16_t ReSetPLLTheta = 0;
    __interrupt void cpuTimer1ISR(void)
    {
        if(ReSetPLLTheta == 1)
        {
            GPIO_writePin(Debug,1);
            ReSetPLLTheta = 0;
            TINV_angleSPLL_radians = 0;
            SPLL_3PH_DDSRF_reset(&TINV_spll_3ph_1);
        }
        TINV_generateInternalReference();
    
        GPIO_writePin(Debug,0);
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    }
    
    void TINV_runTransformOnSensedSignals(void)
    {
        //
        // Run ABC DQ0 POS on the grid voltage
        // with the locked PLL angle
        //
        ABC_DQ0_POS_run(&TINV_vGrid_dq0_pos,
                TINV_vGrid_A_sensed_pu,
                TINV_vGrid_B_sensed_pu,
                TINV_vGrid_C_sensed_pu,
                TINV_sine, TINV_cosine);
    
        //
        // Run ABC DQ0 NEG on the grid voltage
        // with the locked PLL angle
        //
        ABC_DQ0_NEG_run(&TINV_vGrid_dq0_neg,
                TINV_vGrid_A_sensed_pu,
                TINV_vGrid_B_sensed_pu,
                TINV_vGrid_C_sensed_pu,
                TINV_sine, TINV_cosine);
    }
    
    void TINV_generateInternalReference(void)
    {
        //
        // Generate the RAMP TINV_angle
        //
        RAMPGEN_run(&TINV_rgen);
    
        //
        // Compute TINV_angle and sine and cosine
        //
        TINV_angle_radians = TINV_rgen.out * TINV_PI * 2.0f;
    
        //
        // Use the TINV_angle value to compute the sine value
        //
        TINV_sine_A = sinf(TINV_angle_radians);
        TINV_cosine_A = cosf(TINV_angle_radians);
    
        TINV_sine_B = sinf(TINV_angle_radians - TINV_PI * 2.0f / 3.0f);
        TINV_cosine_B = cosf(TINV_angle_radians - TINV_PI * 2.0f / 3.0f);
    
        TINV_sine_C = sinf(TINV_angle_radians - TINV_PI * 4.0f / 3.0f);
        TINV_cosine_C = cosf(TINV_angle_radians - TINV_PI * 4.0f / 3.0f);
    
        TINV_vGrid_A_sensed_pu = TINV_sine_A;
        TINV_vGrid_B_sensed_pu = TINV_sine_B;
        TINV_vGrid_C_sensed_pu = TINV_sine_C;
    }
    
    void TINV_runSPLL(float32_t v_p_d, float32_t v_n_d,
                                    float32_t v_p_q, float32_t v_n_q)
    {
        /*
        SPLL_3PH_SRF_run(v_p_q, &TINV_spll_3ph_2);
    
        TINV_angleSPLL_radians = TINV_spll_3ph_2.theta[1];
        */
        SPLL_3PH_DDSRF_run(&TINV_spll_3ph_1,
                               v_p_d, v_n_d,
                               v_p_q, v_n_q);
        TINV_angleSPLL_radians = TINV_spll_3ph_1.theta[1];
    
    }
    
    //
    // End of File
    //
    

    Best Regards,

    Seamus

  • Seamus,

    yes correct the 4 dq transformation only have a cos and sin.

    Maybe you have a phase shift coming from the measurements itself... They are having also low pass filter effect... This is maybe why you see a phase shift.

    Thanks

    BR