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.

CCS/TMS320F28035: CLA, Solar module issues

Part Number: TMS320F28035
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

In the SolarExplorer project from ControlSuite I want to move SineAnalyzer ans SPLL to CLA. I got two issues.

1) I configure the CLA but when I want to read the data, that is output voltage feedback of the inverter from the ADC it is presented in a weird way.

When I read data from ADC as Uint16, as it is declared in the program I get the correctly sinusoidal wave:

When I try to log it as the float32, and that is what is necessary from the SineAnalyzerCLA I get the weird sinusoidal, that after a couple of samples is shifted and looks like it is mirrored of the average value?

I log the values, by saving them in matrix and save from the memory to .dat and then plot it with excel. I hope the metodology is correct.

2) Another problem I have with the SPLL with CLA. Can I as the input of the SPLL block put the raw ADC data from output voltage feedback? I try also to normalized it but it doesn;t help. The porblem is that I have some weird values sometimes in theta like 2.1e+38 or the same values in the u_Q or u_D component, depend on what values of b0 and b1 I write. ( I use: b0=166.7972 and b1=-166.4431 or b0=222.4750 and b1=-221.8455, from SPLL_coef excel for 40kHz interrupt and respectivly 0.04ms or 0.03ms settling ratio)

  • Hi,

    Due to US Thanksgiving holiday, subject matter expert is out of office. Please expect response by Tuesday Dec 1st. Sincere apology for inconvenience.

  • user5845893 said:
    When I read data from ADC as Uint16, as it is declared in the program I get the correctly sinusoidal wave:

    user5845893 said:
    When I try to log it as the float32, and that is what is necessary from the SineAnalyzerCLA I get the weird sinusoidal, that after a couple of samples is shifted and looks like it is mirrored of the average value?

    If I understand, you are directly reading the result registers as a float?  You will instead need to read the register as a integer and then convert it to float using a cast. (i.e. X = (float)Y;)

    user5845893 said:
    2) Another problem I have with the SPLL with CLA. Can I as the input of the SPLL block put the raw ADC data from output voltage feedback? I try also to normalized it but it doesn;t help. The porblem is that I have some weird values sometimes in theta like 2.1e+38 or the same values in the u_Q or u_D component, depend on what values of b0 and b1 I write. ( I use: b0=166.7972 and b1=-166.4431 or b0=222.4750 and b1=-221.8455, from SPLL_coef excel for 40kHz interrupt and respectivly 0.04ms or 0.03ms settling ratio)

    I'm not familiar with this software.  I will check with a colleague for advice and respond back before end of Wednesday. 

    Regards

    Lori

  • For 2)

    No, the SPLL module expects a level shifted per-unit value, i.e. you will need to subtract the offset on the sensed sinusoid signal and then scale it,

    Typically we use 1,65V offset , for which the per unit offset is 0.5

    a typical read will look like this 

    TINV_vInv_A_sensed_pu = ((float32_t)<ADCRegister> *  ((float32_t)0.000244140625) - 0.5f) * -2.0f;

  • Also if you start the PLL without any input, the PI will saturate and this can cause weird outputs. You may need to reset the PLL when AC line is detected. We have newer modules in the digital power sdk which have reset function

    www.ti.com/.../C2000WARE-DIGITALPOWER-SDK

  • Lori Heustess said:

    If I understand, you are directly reading the result registers as a float?  You will instead need to read the register as a integer and then convert it to float using a cast. (i.e. X = (float)Y;)

    I am using the following formula:

    sineanalyzer_diff_wpwrCLA.Vin = (float32)(Vac_FB_CLA*sinCLA);

    where:

    #define Vac_FB_CLA  AdcResult.ADCRESULT8

    When I try to log values to matrix like this: 

    if(iCLA < 400)
        {
            LogCLA[iCLA]=sineanalyzer_diff_wpwrCLA.Vin;
            iCLA++;
        }
        else
            iCLA=0;

    I get the shape as I describe in topic

  • user5845893 said:
    1
    sineanalyzer_diff_wpwrCLA.Vin = (float32)(Vac_FB_CLA*sinCLA);

    what is sinCLA in this formula? It looks like a call to the sin function, but there are no arguments?

    If you are comparing this graph to the uint16_t case, how is the uint16_t graph created? 

  • Lori Heustess said:

    what is sinCLA in this formula? It looks like a call to the sin function, but there are no arguments?

    I am sorry it was just the coefficient that I temporarily used to scale the input value. Later I changed it to the formula that Manish Bhardwaj send, that is: 

    Sineanalyzer_diff_wpwrCLA.Vin = ((float32)VacCLA *  ((float32_t)0.000244140625) - 0.5f) * -2.0f;

    Lori Heustess said:

    If you are comparing this graph to the uint16_t case, how is the uint16_t graph created? 

    I create the graph by logging values to the matrix of 400 numbers. I pay attention to use the same types in variables. Then I save it from memory browser to .dat file and plot in with Excel.

  • If you plot the uint16_t numbers read from the ADC (before using the formula) is it what you expect?  I suggest starting basic and working your way up - i.e. read the integer values and plot them, then if that looks ok, go to the next step. 

    Regards

    Lori