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.

First PWM pulse wrong generate in offset calibration stage in LAB02a

Other Parts Discussed in Thread: TMS320F28069F, MOTORWARE

I am using TMS320F28069F controller in my board. I implemented example code lab02a. I observed first pulse of PWM during CTRL_State_OffLine and EST_State_Idle (Hardware Offsets Calibrated) stage is more than 50% duty cycle (as mention in spruhj1b, 6.5.2). Because of this passed more current from AC motor. Here some snap in oscilloscope for better understanding.

Can anyone know why this happen? Or something I missed in my code.

Suprit

  • Suprit,

    I am seeing the same waveform during the first initial pulse during CTRL_State_Offline and EST_State_Idle.  I noticed that it only happens once and then never occurrs again.  It will take more time to track down the logic in the software that is causing the delay.

    -Eric

     

  • Eric,

    This Problem occurred in first time motor identification stage ( in CTRL_State_Offline and EST_State_Idle) has performed and every time in power off and power on condition if performing this stage.

    Is there any solution to resolve this condition?

    this condition is resolved in new motor-ware in 1_01_00_10?

  • any one have any idea about above problem?

  • This is not resolved in _10. We are investigating and will fix in a future revision, most likely _12 (which won't happen in 2013, but sometime early in 14)

     

  • Thank you chris,

    at present any solution for this!!

  • at present any solution for this!!

  • Amtech,

    Sorry, this is in our bug system. I'll see if we can post a fix for you as we aren't updating MotorWare again until February it looks like.

     

  • Amtech,

    in your drv.c file, find this line

      // setup the PWMs

    and just previous to this add

      // disable the PWM
      DRV_disablePwm(handle);

     

    Let me know if that works...

  • Suprit,

    Did my solution solve the problem?

     

  • Dear Chris,

    Sorry for delay in reply.

    I checked this, but still problem is there.

  • Sorry about that, I thought that would work.  I'm expecting that this will be fixed in version _12 (February release). If I get confirmation of the fix sooner I'll post it here.

     

  • Dear chris,

    I found same above problem in motorware 13. Is there any solution?

    Regards,

    Suprit Patel

  • Suprit,

    We fixed this (we thought?) in release _12.  If you can reproduce can you please take some scope shots and post relevant details for us to reproduce as well?

  • Dear Chris,

    Here i attache screen shot for your reference.

    if this problem is solved in motorware12 than may be below reason i faced problem.

    Actually i made new project and take reference of project lab2a of motorware9 earlier days. now motorware update to 13, so i simply compare motorware 9 files with motorware 13. and where new change in motorware13 i apply in my project files. so it is possible and fair chance i miss this offset related change in my files and so i face this problem.

    If you have any idea about related change in particular files for offset calibration, than u tell me so i just check it and update it.

    Thanks,

    Suprit

  • Dear Chris,

    Any update??

    Thanks & Regards

    Suprit

  • I'm looking at our changes here...it's not as simple as a diff because we also changed everthying DRV_ to HAL_

    Any chance you can just run MW_13 with your motor to see if it's fixed for you?

  • Dear Chris,

    I done all changes DRV to HAL in my project files.....

    I will check MW_13 and will update you.

    -Suprit

  • Suprit,

    It looks like we WERE able to replicate this with the HVKIT, but not the DRV83x kits....we are looking into the solutions.

     

  • The issue was that the structure gPwmData is initialized after reset, but it is never initialized to zero after running and stopping the motor. So for example, if the motor is running and you stop, then gPwmData will have values that aren't zero. Next time you call the function HAL_enablePwm() the values already written in the PWM double buffers will be outputted on the PWM pins. The solution is this. Change your HAL_disablePwm() function to this:

    static inline void HAL_disablePwm(HAL_Handle handle,HAL_PwmData_t *pPwmData)
    {
      HAL_Obj *obj = (HAL_Obj *)handle;

      PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_1]);
      PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_2]);
      PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_3]);

      pPwmData->Tabc.value[0] = _IQ(0.0);
      pPwmData->Tabc.value[1] = _IQ(0.0);
      pPwmData->Tabc.value[2] = _IQ(0.0);

      return;
    } // end of HAL_disablePwm() function

    And this is how you call it:

    HAL_disablePwm(halHandle, &gPwmData);

    So what's going to happen is that every time you disable PWM outputs, the gPwmData structure will also be initialized to zeros. So next time you call HAL_enablePwm(), the PWM will output a duty cycle of 50%. Now keep in mind that HAL_enablePwm() is called asynchronously compared to the actual PWM, so depending on where the HAL_enablePwm() call actually happen, you might see a first pulse on the pins of length 0 to 50% of a period.

    Please try this new function and let us know if you still see issues.

    Regards,
    -Jorge

  • I am using motorware_1_01_00_14 for the HV_kit. Should this be added to fix this problem or is is fixed somewhere else in the code. I have not noticed a problem yet, but stumbled upon this post and was wondering if this should be added to my code. I am using Lab7 for the 28027F chip for my application. If so, is there an errata for Motorware that can help keep up with bug fixes?

  • Gary,
    it doesn't look like the HAL_disablePwm function has been updated in the hal.h files in MotorWare _14. I have an email in asking why... It looks like you should update to

    static inline void HAL_disablePwm(HAL_Handle handle,HAL_PwmData_t *pPwmData)
    {
    HAL_Obj *obj = (HAL_Obj *)handle;

    PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_1]);
    PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_2]);
    PWM_setOneShotTrip(obj->pwmHandle[PWM_Number_3]);

    pPwmData->Tabc.value[0] = _IQ(0.0);
    pPwmData->Tabc.value[1] = _IQ(0.0);
    pPwmData->Tabc.value[2] = _IQ(0.0);

    return;
    } // end of HAL_disablePwm() function