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.

CCS/TMS320F28379D: Phase-shift PWM

Part Number: TMS320F28379D
Other Parts Discussed in Thread: TMS320F28388D, C2000WARE

Tool/software: Code Composer Studio

Hi Experts

Our customer is developing their system with F28388D. Although customer is evaluating PWM signals, customer observed strange waveform. I attached this one(TMS320F28388D_PWM_Issue_2020_1026.pdf). Operating frequency is 100kHz. Customer is using driverlib on C2000Ware during PWM configuration. Customer was looking into this issue on E2E and notice the similar issue was reported as following thread, however, they cannot find any solution on this thread.

https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/376207?F28069-ePWM-phase-shift-problem

I attached customer's source code(

20201026_drv_epwm_c2.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* drv_epwm.c
*
* Created on: 2019/09/12
*/
#include "F28x_Project.h"
#include <SFO_V8.h>
#include <stdint.h>
#include <stdbool.h>
#include <sysctl.h>
#include <epwm.h>
#include <inc/hw_epwm.h>
#include <inc/hw_memmap.h>
#include <driver/drv_epwm_c2.h>
#include <driver/drv_hrpwm_c2.h>
void InitEPwm1(void);
void InitEPwm2(void);
void InitEPwm3(void);
void InitEPwm4(void);
void InitEPwm5(void);
void InitEPwm6(void);
void InitEPwm12(void); //For measurement 0f CLA internal calculation performance
//======================================
//For High resolution PWM calibration
//======================================
int MEP_ScaleFactor; //Global variable used by the SFO library
//Result can be used for all HRPWM channels
//This variable is also copied to HRMSTEP
//register by SFO(0) function.
// Used by SFO library (ePWM[0] is a dummy value that isn't used)
volatile uint32_t ePWM[PWM_CH_MAX + 1] = {0, EPWM1_BASE, EPWM2_BASE, EPWM3_BASE, EPWM4_BASE};
//*****************************************************************************
// EPWM�̏�����
// ���� �Ȃ�
// �߂�l �Ȃ�
//*****************************************************************************
void init_EPwm(void){
InitEPwm1(); //PWM for high-voltage class D amplifier
InitEPwm2(); //PWM for high-voltage class D amplifier
InitEPwm3(); //PWM for high voltage DCDC converter
InitEPwm4(); //PWM for high voltage DCDC converter
InitEPwm12(); //For measurement 0f CLA internal calculation performance
SFO();
}
//*****************************************************************************
// ������\PWM�̃L�����u���[�V����
// ���ԊԊu�ŕK�����s����B
// ���� �Ȃ�
// �߂�l �Ȃ�
//*****************************************************************************
void HrPwmCal(void){
SFO();//PWM Calibration
}
//*****************************************************************************
// EPWM1�̏�����
// ����D���A���v�pPWM�o�� �p���X���·
// ���� �Ȃ�
// �߂�l �Ȃ�
//*****************************************************************************
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
). Can we have your Expert's advice/comments on this, please?

Best regards,

Miyazaki

  • At run time, do you change the CMPx values?

    Also can you please tell me are you using high resolution phase shift between the EPMW modules?

    HRPWM_setMEPControlMode(EPWM1_BASE, HRPWM_CHANNEL_A, HRPWM_MEP_PHASE_CTRL);
    HRPWM_setMEPControlMode(EPWM1_BASE, HRPWM_CHANNEL_B, HRPWM_MEP_PHASE_CTRL);

    Also can you in a short description tell me the features in EPWM you are using so I can cross check them with the code?

    EPWM in UP mode

    PERIOD load is DIRECT

    HR mode enabled

    HR Phase mode

    Anything else I am missing?

  • Hello Nima,

    We are asking customer your questions. when we will receive their feedback, I'll share them as soon as possible.

    Best regards,

    Miyazaki

  • Hi Nima,

    I received customer feedback.

    > At run time, do you change the CMPx values?

    Yes, customer is changing CMPA/CMPB during operation. CMPx value is set from “0” to a 50 % Duty-ratio. Normally, since customer is using Phase-Shift-PWM, it is operated with 50% duty ratio. When stopping the PWM, CMPx is set to “0” and PWM-A/PWM-B output are fixed to logical value.

    > Also can you please tell me are you using high resolution phase shift between the EPMW modules?

    Yes, customer is using HR phase shift. EPwm2 synchronizes with EPwm1

     

    Customer’s configuration is as follows.

    EPWM in UP mode
    
    PERIOD load is DIRECT
    
    High Resolution mode
    
    HR Phase mode
    
    Synchronization Mod is Enabled :when the counter of PWM1=0y, other PWM is synchronized.
    
    A 100kHz output PWM waveform is generated.

    I’m sorry. I just translated customer’s comments in English. I hope these information includes some hints of solution.

    Best regards,

    Miyazaki

  • Are you aware that the HR module is not supposed to be used with less than 3 cycle duty close to the PRD and ZERO?

  • I looked over your code again as well and it seems like you want to do BOTH EDGE (rising and falling) using HRPWM in UP-MODE.

    Thats not supported, you can only control one edge in CTR=UP-Mode, you need to be running in UP-DOWN mode if you want to use the BOTH EDGE control mode.

    Nima

  • Hello Nima,

    Thank you for your advice. Regarding the limitation of “less than 3 cycle duty”, I received customer's feedback, just now. customer was trying to check this with their system. As the result, customer was able to notice that their firmware sometime set less than 3 cycle duty. Customer fixed this configuration and confirmed this issue was fixed.

    I really appreciate your help.

    Best regards,

    Miyazaki