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.

3-phase PLL implementation

Other Parts Discussed in Thread: CONTROLSUITE

Dear all,

currently in the frames of my student project I am working with F28335. We trying to create an active infeed converter to feed the energy in the power grid. Honestly I have very few experience in the programming of TI microcontrollers. The code which I have already created, is doing the following:

1. PWM module generates a SOC for ADC. ADC reads the values of currents and voltages in the power grid.

2. In the end of ADC conversation the microcontroller generates an interrupt.

3. In the interrupt I use the Clark transformation from "Solar library"

4 Futher, I have to implement PLL, since I need Theta for Pakr transformation. But I do not understand, how the SPLL_3ph_SRF_IQ_H_module works. Could somebody explain it more in detail, than in the documentation of Solar library.

Q: Is it normal that I am going to implement call PLL inside of main interrupt?

Q: What does mean this prase from Solar Libruary documentation: "the inverter ISR period value and the address of the pll object. Ensure that the ISR is running at a minimum frequency of 20KHz." If I undertood right, I have to call PLL function with the frequency higer than 20KHz but my PWM freqeunce is 4kHz and in the end of each interrupt I fill out PWM compare register for next PWM period. Moreover I'm reading the ADC values with frequency 4kHz as well. Should I organize PLL in the other interrupt, and call it with a higher frequency?

Q: Could somebody show me the code with implemented SPLL_3ph_SRF_IQ_H_. Unfortunatly in the project, provided by Mr. Choudhury "0083.ThreePhasePFC_Code.rar" I did'n fild PLL module.

I will be very grateful if somebody helps me. 

Regards,

Illia 

  • Please see 

    http://www.ti.com/lit/an/sprabt4a/sprabt4a.pdf 

    for details on PLL implementation, 

    the statement just means that the loops have been tuned for 20Khz call rate of the PLL module. 

    Also download controlSUITE, there is an excel sheet there under libs/app_libs/solar/v1.2/spll_coeff_compute which you can use to calculate the coefficients 

    Regards

    Manish Bhardwaj

  • Dear Manish,

    Thank you for this response. It seems like I have figure out how to use this module. The other small problem appeared. The value of theta flying into infinity...

    This is the part of the code responsible for the module use:

    transform1.a = ((VoltageA - Offset) * 0.00024414)*2;
    transform1.b = ((VoltageB - Offset) * 0.00024414)*2;
    transform1.c = ((VoltageC - Offset) * 0.00024414)*2;
    transform1.sin = (float)sin((spll1.theta[1]));
    transform1.cos = (float)cos((spll1.theta[1]));

    ABC_DQ0_POS_F_MACRO(transform1);

    spll1.v_q[0] = (transform1.q);

    SPLL_3ph_SRF_F_MACRO(spll1)

    My expectation are that the theta has to be in radians, e.g maximum value is 2 PI.

    Should I implement a limitation manually and return to 0, when the angle reached 2 PI?

    Regards,
    Illia
  • Illia,

    the SRF PLL block should be doing this ..

    if(spll_obj->theta[0] > (float32)(2*3.1415926))
    spll_obj->theta[0]=spll_obj->theta[0] - (float32)(2*3.1415926);

    but looking at this i noticed that if by an chance theta starts going negative it does not have a wrap around for that

    Hence another else statement must be added

    else if(spll_obj->theta[0] < (float32)(0))
    spll_obj->theta[0]=(float32)(2*3.1415926)+spll_obj->theta[0];

    but make sure you call the PLL init function which initializes everything before calling the run time function..