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-F28069M: Instaspin Lab04a with discrete resolver code

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: C2000WARE

Hi,

I'm setting up the F28069M registers for the DIY inverter.

My plan is to do field-oriented current control using the discrete resolver.

So, I'm modifying the Instaspin Lab04a base code making an excitation signal for the discrete resolver.

EPWM1, 2,3 have 10kHz frequency for each phase of gate drive signal with ADC interrupt and EPWM4 has 175.78kHz frequency for the excitation signal with ADC interrupt

Since I turn on the gate PWM, EPWM4 interrupt has a weird delay periodically(3.35kHz) (see the yellow arrow below picture)

 

Let me know if anyone knows what caused it.

  • How many interrupts are enabling in your project? Do you enable the interrupt nesting if there are multiple ISRs in your project. You might refer to the example in the folder of the C200Ware as below for interrupt nesting.

    C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f28004x\examples\interrupt

  • Just wanted to check in and see if there is any update from your side, I haven’t heard from you for two weeks, so I’m assuming you were able to resolve your issue. Please let me know if you have any questions. We would like to close this thread if no any further questions. Thanks.

  • Although I checked interrupts in my code, I wasn't able to find any 3.3kHz interrupt routine.

    but I found some of code(ETPS) in "hal.c" makes this weird delay.

    Could you explain what is the purpose of ETPS?

    ======================================Original code===================================

    // setup the Event Trigger Prescale Register (ETPS)
    if(numPwmTicksPerIsrTick == 3)
    {
    PWM_setIntPeriod(obj->pwmHandle[PWM_Number_1],PWM_IntPeriod_ThirdEvent);
    PWM_setSocAPeriod(obj->pwmHandle[PWM_Number_1],PWM_SocPeriod_ThirdEvent);
    }
    else if(numPwmTicksPerIsrTick == 2)
    {
    PWM_setIntPeriod(obj->pwmHandle[PWM_Number_1],PWM_IntPeriod_SecondEvent);
    PWM_setSocAPeriod(obj->pwmHandle[PWM_Number_1],PWM_SocPeriod_SecondEvent);
    }
    else
    {
    PWM_setIntPeriod(obj->pwmHandle[PWM_Number_1],PWM_IntPeriod_FirstEvent);
    PWM_setSocAPeriod(obj->pwmHandle[PWM_Number_1],PWM_SocPeriod_FirstEvent);
    }

    ================================================================================

    ======================================Edited code===================================


    // setup the Event Trigger Prescale Register (ETPS)

    PWM_setIntPeriod(obj->pwmHandle[PWM_Number_1],PWM_IntPeriod_ThirdEvent);
    PWM_setSocAPeriod(obj->pwmHandle[PWM_Number_1],PWM_SocPeriod_ThirdEvent);

    ================================================================================

  • This programs the event prescaling options, which means an event will be trigger every one, two, or three PWM cycles.

    You might take a look at chapter  3(Enhanced Pulse Width Modulator (ePWM) Module) of F2806x TRM if you want to know more about EPWM.