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.

Questions about Software Phase Locked Loop (SPLL) using CLA solar library

Other Parts Discussed in Thread: CONTROLSUITE

HI,

<Sorry for this long message, but I have to explain to in details.>

I am now using CLA solar library with a F28069 Piccolo Experimenter Kit  to implement the Phase Locked Loop. I follow the document “CLA C Solar Library” V.1.1 to implement the SPLL. There are few questions during the development. I hope if anyone can give me a hand.

  1. As described in the document page 23, the initialization function “SPLL_1ph_CLA_C_INIT(spll1, 50, (0.00005));” is put in the {ProjectName}-Main.c, I found that the function cannot gets problems. As I saw from the emulator that the variables inside the function cannot be inititialzed. Then, I put it into task 8 of the CLA ISR. The problem can be solved. I just wanna confirm is this initialization should be put into CLA task8 ISR instead of putting in the main.c?
  2. After that, I still not be able to implemnt the SPLL as the variables cos1 cos0 sin1 sin0 are all become zero after SPLL_1ph_CLA_C(spll1) onetime, seems from the CCS using the emulator.

 

P.S. I tried the following source of AC_input, the results are the same:

1.       Using a signal generator to generate 0~3.3V sine wave with 1.165V offset and a ADC channel to pick it up:

    //adcvalue = ADCDRV_1ch_CLA_C(AdcResult.ADCRESULT1);

    //spll1.AC_input = (adcvalue - 0.5) * 2;

 

2.           A global variable CLA_PLLVal ( a sine value generated using float point function sin()):

    //1000 samples!

    if (OpenPll.TimeTick == 1000)

    {

         OpenPll.TimeTick=0;

         openpll_temp1 = 0;

         CLA_PLLVal = 0;

    } else {

         OpenPll.TimeTick++;

         openpll_temp1 = sin(PIX2*50*OpenPll.TimeStep*OpenPll.TimeTick);

         CLA_PLLVal = openpll_temp1;

 

    }

P.S2. The SPPL is put in CLA task1, triggered by PWM1 interrupt, 20kHz.

 

Thanks,

Barry

  • Hi All,

    Today, I removed all the CLA SPLL contents. Instead, I used Float Solar Library to implement the SPLL and it works fine.  Seems that there is something wrong on the CLA part. I post the compile command here and hope that TI can follow up this thread.

    -v28 -ml -mt --cla_support=cla0 --float_support=fpu32 --vcu_support=vcu0 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="C:/ti/controlSUITE/device_support/f2806x/v136/F2806x_headers/include" --include_path="C:/ti/controlSUITE/device_support/f2806x/v136/F2806x_common/include" --include_path="C:/ti/controlSUITE/development_kits/~SupportFiles/F2806x_headers" --include_path="C:/ti/controlSUITE/libs/math/IQmath/v15c/include" --include_path="C:/ti/controlSUITE/libs/app_libs/digital_power/f2803x_v3.4/include" --include_path="C:/ti/controlSUITE/libs/app_libs/digital_power/f2803x_v3.4/asm_macros" --include_path="C:/ti/controlSUITE/libs/app_libs/digital_power/f2803x_v3.4/C_macros" --include_path="C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/include" --include_path="C:/ti/controlSUITE/libs/app_libs/solar/v1.1/CLA_C" --include_path="C:/ti/controlSUITE/libs/app_libs/solar/v1.1/float" --define="_DEBUG" --define="LARGE_MODEL" --diag_warning=225

    I also tried  -O4 -ms , and the result is the same.

    Thanks and regards,

    Barry

  •  I think I can find the cause of the problem. There is a mistake on the template inside ControlSuite:C:\ti\controlSUITE\development_kits\TemplateProjects\DPLibv3_4Template-F2803x

    The linker command  file should be 28xxx_RAM_CLA_C_lnk.cmd.

    We will come across lots of errors when using CLA if we use the linker command file F28035_FLASH_ProjectName.CMD or F28035_RAM_ProjectName.CMD.

    BR,

    Barry