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/TMDSSOLARUINVKIT: C2000 micro inverter questions

Part Number: TMDSSOLARUINVKIT
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hi,

  I would like to increase the inverter frequency from 50kHz to 100kHz or 200kHz. I have modified "#define INV_FREQ 50000.0" to "#define INV_FREQ 100000.0" in SolarMicroInv-Settings.h, but it doesn't work. May I know what are those parameters changed in the code? Thanks.

  • Typically, you will need to debug the code :) 

    Check if PWM registers are written correctly, ISRs are triggering.

  • Hi Manish,

     The code was released from TI that is located under "\ti\controlSUITE\development_kits\TMDSSOLARUINVKIT_v100\MicroInv_F2803x\ ". You may see the attachment.MicroInv_F2803x.zip

  • Hi, Unfortunately I don't have bandwidth to debug your code, i.e. once it is modified from the released.

    I can offer you suggestion , or how I will go about testing it. I will begin with build level 1. Maybe start slow in the change of PWM frequency and see if it is allowing any change at all... there might be places in the code where it may be hardcoded.

    We have been doing a better job in some of our new code examples, but micro inverter code was developed long time back and may have some hard coded pieces that are preventing from update to the PWM frequency.

    -Manish
  • Hi Manish,
    I didn't modify the code from release. I just used the released code, and modify its "#define INV_FREQ 50000.0" to "#define INV_FREQ 100000.0" in SolarMicroInv-Settings.h, and see if I can increase the inverter frequency from 50kHz to 100kHz. However, there was no output after doing this. I also built level 1, and started slow in the change of PWM frequency, i.e. "#define INV_FREQ 50000.0" to "#define INV_FREQ 75000.0; however, the PWM frequency of Flyback stage also changed from 100kHz to 75kHz. Things seemed illogical . What are possibilities you think will cause this problem?
  • You can look at the PWM TBPRD register to see what is gettig programmed there.
  • Hi Manish,

    PWM TBPRD register is configured by "PWM_MicroInvLineClamp_CNF(1, (CPU_FREQ/(INV_FREQ)), INV_DEADBAND, INV_DEADBAND);" in line 351 of "SolarMicroInv-Main.c" in released code. As I mentioned above, I built level 1, and changed the PWM frequency, i.e. "#define INV_FREQ 50000.0" to "#define INV_FREQ 75000.0; however, the PWM frequency of Flyback stage also changed from 100kHz to 75kHz. Things seemed illogical .
  • I tried this on my end, the relation between the flyback and inverter PWM frequency is because of the sync.

    You can disable this by making the following change

    // Put DC-DC PWM configuration here
    PWM_1ch_UpDwnCnt_CNF(3, (CPU_FREQ / (FLYBACK_FREQ)), 1,
    (CPU_FREQ / (FLYBACK_FREQ * 2)) - 2);


    Notice the mode is "1" , i.e. master and not slave. With this you will get the correct PWM at the output.

    I tried changing the INV PWM as well, with the following change so i cam measure the frequency on the scope correctly

    //duty_inv_pu=_IQ24mpy(InvSine,InvModIndex);
    duty_inv_pu=InvModIndex;

    WIth changes to 70KHz , I am able to see PWM. with 100kHz i am able to see PWM. SO i can verify the provided code is good.

    YOu will need to do more debug on your end to indetify the issue in your code.
  • Hi Manish,

    Thanks. For the inverter, I can see the PWM output under 70kHz, but it doesn't work with 100kHz (I found that red LED on control card is not blinking under this circumstance).
  • Hi,

    I will recommend you re-download controlSUITE to make sure there are no changes from the one we provided.

    In build level 1, i tested the inverter with 100kHz and I am able to see the PWM, the only change i had to do was what i pointed to above to make sure i don;t see sinusoidal PWM when i am just checking 100kHz programming.

    Also note, the CPU load is very high with even 50kHz PWM, if you have added additional code to the ISR there might not be enough MIPS. LED not blinking is a worrisome signs. I will recommend putting some breakpoints etc to find the root cause of the issue as well.
  • Hi Manish,

    Yes, I used the latest release from controlSUITE, and there are no changes from the release code. With the changed you mentioned above, I can see 70kHz PWM from inverter, but I can not see PWM after changing to 80kHz, and neither do 100kHz; However, I found that the red LED was not blinking so I try to increase the CPU clock to 75MHz by following changes in "SolarMicroInv-DevInit_F2803x.c" and "SolarMicroInv-Settings.h", respectively.
    - SolarMicroInv-DevInit_F2803x.c
    PLLset(0xF); // choose from options above
    - SolarMicroInv-Settings.h
    #define CPU_FREQ 75000000

    By doing above, I can see PWM till 96kHz, but none above. I can not see 100kHe and LED blinking, either.
  • 1. I will highly not recommending over clocking the device, operation with an overclocked device are not guarnteed.

    2. The interrupt generation in the code is controlled by

    EPwm2Regs.ETPS.bit.SOCAPRD = ET_1ST;

    you can change it to ET_3RD to see if that helps.

    However I still cannot understand why i see the PWM and you do not on your end , that does not make sense.
  • Hi Manish,

    I don't know why I can not see 100kHz PWM on my side, either. I used CCS V8 to build the release code, and got 4 warrings. Do you think it is a root cause? Anyway, when I changed "EPwm2Regs.ETPS.bit.SOCAPRD = ET_3RD", I can see 100kHz PWM, but when I configured to build level 3 with grid connect, the "PVInverterState" showed "FaultState", and "FaultFlag" showed "OverVoltageDCBus" every time. It seems to me that it doesn't work.
  • It;s not simple to change PWM frequency, you need to re-tune your loops etc. to make sure they are still stable at those higher frequencies.
  • Hi Manish,

    As for disabling the sync this by making the following change:

    // Put DC-DC PWM configuration here

    PWM_1ch_UpDwnCnt_CNF(3, (CPU_FREQ / (FLYBACK_FREQ)), 1,

    (CPU_FREQ / (FLYBACK_FREQ * 2)) - 2);

    Are there any disadvantages by disabling the sync? It is my understanding that there are particular reasons to have the sync between the Flyback and the inverter mentioning in the user guide (p.16) as follows.

    “The DC-DC stage is switched at 100 Khz and DC-AC stage at 50 Khz. The peripheral ADC and PWMs on the C2000 device family have been designed to integrate multifrequency control loops and guarantee sampling at correct instances of the PWM waveform. However, as only one ADC is present (two sample and holds), the multi rate ISRs must not conflict with the ADC resource at any instance. For this the phase, the shift mechanism of the PWMs on the ePWM peripheral is employed. Figure 18 illustrates the timing diagram for configuring the EPWM for the inverter, and shows how to generate PWM waveforms for both the positive and negative half of the sine wave.”

  • Hi,

    On F28035 class device my advice will be to keep multiple of frequency when there are multi loop control type situations.
    There can be small delays in sampling of the signal however i do not deem them critical in micro inverter application, however not ideal.

    Ultimately you have to ask yourself is it detrimental to the performance of the converter.

    We do have multiple ADCs on our newer devices. Where you have more freedom.

    Regards
    Manish Bhardwaj