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.

TMS320F280049C: InstaSPIN-FOC Lab: is12_variable_pwm_frequency

Part Number: TMS320F280049C
Other Parts Discussed in Thread: TMS320F28069F, MOTORWARE,

Hello,

I have a question on InstaSPIN Projects and Labs User's Guide: InstaSPIN-FOC for F28004xC.

Specifically it is on is12_variable_pwm_frequency.

Our motor inverter has been built with the TMS320F28069F device.

We wish to implement the function of online variable switching frequencies in our motor inverter.

Would it be feasible anyhow?

If not, please explain the reasons in detail.

For instance, I have noticed that the library name of the fast estimator in the MotorControl SDK is f28004x_fast_rom_symbols_fpu32.lib.

Is this library not able to be used for the TMS320F28069F device?

Thank you for your guidance.

With regards,

JS Yoo

  • Yes, you can implement this technique to F28069 which is not related to the instaspin-foc FAST library. You just need to use two ISRs, one is a fixed period to execute the FAST algorithm to estimate the rotor position and speed controller, one is the variable period to get the current sampling value for the current controller.

    No,  the f28004x_fast_rom_symbols_fpu32.lib can't be use for the TMS320F28069F device. Each series of the device has its dedicated library to match the FAST codes stored in the ROM. 

  • Dear Yanming Luo,

    Thank you for your review.

    Unfortunately our motor inverter uses the TMS320F28069F device which is related to the instaspin-foc FAST library included in motorware_1_01_00_18.

    My question is that whether our motor inverter can implement the function of online variable switching frequencies with the TMS320F28069F device that uses the instaspin-foc FAST library included in motorware_1_01_00_18 or not.

    If our present motor inverter cannot implement that function and we have to use the instaspin-foc FAST library for that function, then do we have to redesign our motor inverter with the TMS320F280049C device?

    I appreciate your guidance.

    With regards,

    JS Yoo

  • As mentioned above, the variable PWM frequency technique is independent of the device and FAST library. Yes, you can implement the variable PWM frequency technique on F28069F with its instaspin-foc FAST library in motorware_1_01_00_18.

  • Hi Yanming Luo,

    Thank you for your review.

    Unfortunately I cannot keep up with you.

    I have found that the C codes in the file of is12_variable_pwm_frequency.c call lots of EST functions that is not available in the instaspin-foc FAST library in motorware_1_01_00_18.

    For instance, EST_initEst() and EST_setParams() functions are called in the function of main(); however they are not available in the instaspin-foc FAST library in motorware_1_01_00_18. They seem to be only available in the instaspin-foc FAST library in the MotorControl SDK_3_01 for F28004xC.

    In addition, a few EST functions are called in the interrupt function of estISR().

    For instance, EST_getIdq_A(), EST_getIdRated_A(), EST_updateId_ref_A(), and EST_setIdq_ref_A() functions are called in estISR(); however they are not available in the instaspin-foc FAST library in motorware_1_01_00_18. They seem to be only available in the instaspin-foc FAST library in the MotorControl SDK_3_01 for F28004xC.

    Moreover the EST_run() function has different parameters from the instaspin-foc FAST library in motorware_1_01_00_18.

    Therefore I may not be able to implement the variable PWM frequency technique on F28069F with its instaspin-foc FAST library in motorware_1_01_00_18.

    Please resolve my trouble.

    Thank you for your guidance.

    With regards,

    JS Yoo

     

  • You can still use the FAST functions in motorWare, just need to call these functions separately in two ISRs as mentioned above. You might use lab11a in motorWare to do this.

    One ISR is a fixed period to execute the FAST algorithm to estimate the rotor position and speed controller.

    One ISR is the variable period using PWM frequency to get the current sampling value for the current controller.

  • Hi Yanming Luo,

    Thank you for your review.

    I am now trying to build two ISR functions of estISR() and mainISR() from the mainISR() in Lab11a of the motorware as in the is12 lab of the MotorControl SDK.

    However I have one question on the the mainISR() in Lab11a of the motorware. The mainISR() in Lab11a calls TRAJ_run(trajHandle_Id).

    Should I call TRAJ_run(trajHandle_Id) from estISR() or still in mainISR()?

    Moreover, with respect to the is12 lab of the MotorControl SDK, TRAJ_run(trajHandle_Id) is not called from either estISR() or mainISR().

    Please explain me the reason that TRAJ_run(trajHandle_Id) is called from the mainISR() in Lab11a of the motorware but it is not called from either estISR() or mainISR() in the is12 lab of the MotorControl SDK.

    Thank you for your guidance.

    With regards,

    JS Yoo

  • You don't need to call the same functions as the lab12 in motorControlSDK, just need to split these functions in one ISR in lab11a to two ISRs.

    You might only read ADC results and update PWM in mainISR, and call all of the other functions in estISR.

  • Hi Yanming Luo,

    Thank you for your review.

    It is very difficult for me to split the mainISR() in lab11a into two ISRs of estISR() and mainISR().

    Would you please split the mainISR() in lab11a into two ISRs and attach the source files to this post for me?

    I will be very grateful for your work.

    With regards,

    JS Yoo

  • I don't think it's very difficult to do this by yourself, you might refer to the lab in motor control SDK to split the codes into two ISRs as I mentioned above. And let's know if you meet any further questions.

  • Hi Yanming Luo,

    Thank you for your review.

    The following code snippet is in the mainISR() of the file of proj_lab11a.c.

          // get the reference value from the trajectory module
          refValue = TRAJ_getIntValue(trajHandle_Id) + EST_getRsOnLineId_pu(estHandle);

    Should I place this line of codes in the estISR() or the mainISR()?

    Thank you for your guidance.

    With regards,

    JS Yoo

  • You might just call the following codes in the variable frequency ISR, and call other codes in the fixed frequency ISR.

    // acknowledge the ADC interrupt
    HAL_acqAdcInt(halHandle,ADC_IntNumber_1);

    // convert the ADC data
    HAL_readAdcDataWithOffsets(halHandle,&gAdcData);

    // remove offsets
    gAdcData.I.value[0] = gAdcData.I.value[0] - gOffsets_I_pu.value[0];
    gAdcData.I.value[1] = gAdcData.I.value[1] - gOffsets_I_pu.value[1];
    gAdcData.I.value[2] = gAdcData.I.value[2] - gOffsets_I_pu.value[2];
    gAdcData.V.value[0] = gAdcData.V.value[0] - gOffsets_V_pu.value[0];
    gAdcData.V.value[1] = gAdcData.V.value[1] - gOffsets_V_pu.value[1];
    gAdcData.V.value[2] = gAdcData.V.value[2] - gOffsets_V_pu.value[2];

    // run the current reconstruction algorithm
    runCurrentReconstruction();

    // run Clarke transform on current
    CLARKE_run(clarkeHandle_I,&gAdcData.I,&Iab_pu);

    // run Clarke transform on voltage
    CLARKE_run(clarkeHandle_V,&gAdcData.V,&Vab_pu);

    // write the PWM compare values
    HAL_writePwmData(halHandle,&gPwmData);

  • Hi Yanming Luo,

    Thank you for your review.

    Let me return to you soon as I work on this project.

    With regards,

    JS Yoo