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.

LAUNCHXL-F280049C: changing switching frequency problem

Part Number: LAUNCHXL-F280049C

Tool/software:

Hi, 

We are running our motor with F280049C and boostXL-DRV 8323 with the following MATLAB example.

the motor runs fine in open and close loop at PWM_frequency = 20 Khz. we would like to see the current harmonics at 32 and 40 kHz. However when we change the frequency to higher than 24 Khz , the actual speed (from sensor) will become half the command speed. This behavior cannot be observed in Simulink scopes as it seems like the speed is following the command properly (but in reality it is half). It does work for 24Khz but nothing above that. We were wondering if you can help us with this problem. 

another question that we have is that it seems when we set the  PWM_frequency = 20 Khz, the switching frequency is double this value (40Khz) while the current sampling frequency remain at 20Khz.  why is that?

Thanks for your help in advance. 

  • Hi

    Thanks for reaching out on E2E forums!

    The best answer would be given by MathWorks since they own the example. I can suggest a few things before you reach out to them.

    One plausible explanation is that your control ISR is saturating beyond 24kHz. You might need to optimize the algorithm or use a higher frequency device to mitigate this issue.

    Can you try first enabling optimization (O2) if it is not already done?

    In the model, go to hardware settings / configuration parameters --> code generation tab --> select "Faster Runs" in the build configuration drop down.

    This should significantly boost your performance.


    There are more optimization settings that you can do. Refer Section 3 in MATLAB® and Simulink® Model-Based Design Using C2000Tm Microcontrollers (Rev. A)

    If you still need some help on this example, I'd suggest you post this on MathWorks forum.

    A