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.

Set SVG minwidth in motorware

Other Parts Discussed in Thread: TMS320F28069

Hi chris:

I don't understand these sentence function in motor ware:

  // Initialize and setup the 100% SVM generator
  svgencurrentHandle = SVGENCURRENT_init(&svgencurrent,sizeof(svgencurrent));

  {
    float_t minWidth_microseconds = 2.0;
    uint16_t minWidth_counts = (uint16_t)(minWidth_microseconds * USER_SYSTEM_FREQ_MHz / 2.0) + HAL_PWM_DBFED_CNT;

    SVGENCURRENT_setMinWidth(svgencurrentHandle, minWidth_counts);
  }

Is this define dead time on pwm?  or what will it do?

best regard!

yanzheng fu

  • Yes, exactly. From hal.c

          // setup the Dead-Band Falling Edge Delay Register (DBFED)
          PWM_setDeadBandFallingEdgeDelay(obj->pwmHandle[cnt],HAL_PWM_DBFED_CNT);

  • but

    void SVGENCURRENT_setMinWidth(SVGENCURRENT_Handle svgencurrentHandle,const int16_t minwidth)
    {
      SVGENCURRENT_Obj *svgencurrent = (SVGENCURRENT_Obj *)svgencurrentHandle;

      svgencurrent->MinWidth = minwidth;
     
      return;
    } // end of SVGENCURRENT_setMinWidth() function

     SVG is not deadband.

  • Sorry, I misread your original question 

    Svgencurrent replaces svgen in lab10 when oveodulation technique is shown. 

    Part of the solution allows you to adjust the minimum low side switch on time that is acceptable to use in current feedback. 

    I thought we would have the description in the lab guide by now but it hasn't made it quite yet...

  • hi: chris

    " adjust the minimum low side switch on time"

    Can you detail this method, or post  any document ?

    Other serious problems are:

    1. I use my board , when I changed the internal osc1 to crystal osc. then run 28069, it burn the IPM ! my crystal is 20M.  I didn't edit HAL_setPLL.  should I use 10M crystal osc? 

    2. I want use 1ms timer , and I try use ISR_Freq do it. but it is hard ,

    because:  in mainISR():

    there is

    "

      // toggle status LED
      if(gLEDcnt++ > (uint_least32_t)(USER_ISR_FREQ_Hz / LED_BLINK_FREQ_Hz))
      {
        HAL_toggleLed(halHandle,(GPIO_Number_e)HAL_Gpio_LED2);
        gLEDcnt = 0;
      }

    “

    if  USER_ISR_FREQ_Hz=15, LED_BLINK_FREQ_Hz=2000,  HAL_Gpio_LED2 will toggle at 1ms  . but when I use oscoper to watch it . it is not 1ms! I think that is must not integrated number when divied 15000/2000, otherwise, in mainISR(), this place use the divied. not use IQdiv(); it is will spend long time every time mainISR() call/

    I will use time0, or time1 interrupt to occur 1ms . (because 1ms it will be use as a time of backgroud run). but time0 you use it to FEM. and time1, you use it to CPU_USAGE. (truth to tell , I haven't understand these two function by now.) . that mean I just only use time2?

    3. I use GPIO to emulate time out. and test the timer pricision. in the end I burn the 28069M .  that time MCU hat high. I used HAL_Gpio_LED2 as time out. I set the USER_ISR_FREQ_Hz=15, LED_BLINK_FREQ_Hz=2000,

    I want to know GPIO use toggle function ,what max freq is? and current?

    sorry , I have so many problem!

  • yanzhen fu said:

    " adjust the minimum low side switch on time"

    Can you detail this method, or post  any document ?

    in the svgen_current, if a given phase's low side on-time is smaller than the minimum # of counts you set, the current measurement will be ignored. This logic is handled by

    SVGENCURRENT_RunIgnoreShunt

    and then the three currents are determined based on the good sample(s) by the logic from

    SVGENCURRENT_RunRegenCurrent

    yanzhen fu said:
    1. I use my board , when I changed the internal osc1 to crystal osc. then run 28069, it burn the IPM ! my crystal is 20M.  I didn't edit HAL_setPLL.  should I use 10M crystal osc? 

    you should use a 10M crystal or reconfigure your pll settings for the 20M crystal.

    2. you're trying to make your LED blink at 2 KHz? Why?  Did you mean 2 Hz? 

    3. I don't understand this question / comment. I think you have again confused Hz and kHz though.

  • 2. yes  , I i make led link at 2kh/2=1kH, because ,I want make 1ms timer as backgroud .

    time0.has used to FEM,and timer1 used to CUP_USEGE now.

  • you are correct, the final value must be an integer. Right now it should be ticking at 1.875 KHz.

    Why not run your PWM @ 16 KHz?

    BTW - you can change out the timer0 and timer1, those are just examples.

  • Chris: where can I  find   description of  GPIO max swich frequence and max current  consumption? ( except clockout and clockin pin)。 because I want to know the reason of  28069 turned .

  • sorry. mistake "28069 turned" , it is 28069 burned.

  • This is either in the datasheet or the technical reference manual that you can find at 

    Www.ti.com/product/tms320f28069