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/TMS320F28069M: SOC from PWM for low side current sensing

Part Number: TMS320F28069M
Other Parts Discussed in Thread: BOOSTXL-DRV8305EVM, LAUNCHXL-F28069M, DRV8305

Tool/software: Code Composer Studio

Hi,

I use EPWM for SOC of ADC for low side current sensing.I think the right time for reading the low side current sensing amplifier is when the high side MOSFET of every indivithual leg is off. But i can just read correct current when the high side MOSFET is on.Also, i use BOOSTXL-DRV8305EVM with LAUNCHXL-F28069M.The EPWM is configured as:

EALLOW;
EPwm1Regs.TBPRD=225;
EPwm1Regs.TBPHS.half.TBPHS=0;
EPwm1Regs.TBCTR=0;
EPwm1Regs.TBCTL.bit.FREE_SOFT=2;
EPwm1Regs.TBCTL.bit.CLKDIV=0;
EPwm1Regs.TBCTL.bit.HSPCLKDIV=5;
EPwm1Regs.TBCTL.bit.SYNCOSEL=TB_CTR_ZERO;
EPwm1Regs.TBCTL.bit.PRDLD=TB_IMMEDIATE;
EPwm1Regs.TBCTL.bit.PHSEN=TB_DISABLE;
EPwm1Regs.TBCTL.bit.CTRMODE=TB_COUNT_UPDOWN;
EPwm1Regs.CMPA.half.CMPA=0;
//EPwm1Regs.CMPB=0;
//EPwm1Regs.TBCTR=0;
EPwm1Regs.CMPCTL.bit.SHDWAMODE=CC_IMMEDIATE;
EPwm1Regs.CMPCTL.bit.SHDWBMODE=CC_IMMEDIATE;
///
EPwm1Regs.AQCTLA.bit.CAU=AQ_CLEAR;
EPwm1Regs.AQCTLA.bit.CAD=AQ_SET;
///
//EPwm1Regs.ETSEL.bit.INTEN=1;
EPwm1Regs.ETSEL.bit.INTSEL=3;
EPwm1Regs.ETPS.bit.INTPRD=1;
///
EPwm1Regs.ETSEL.bit.SOCAEN=1;
EPwm1Regs.ETSEL.bit.SOCASEL=5;
EPwm1Regs.ETPS.bit.SOCAPRD=1;
EDIS;

Regards,
Mohammad.

  • Mohammad,

           you should measure the currents when current shunts are connected to the the motor coils.

    Since you are using low side shunts you should do this when all of the high-side drivers are off, and all low-side drivers are on.

    In our example software we center our low side gate driver pulse around zero. So if you are using a similar scheme to our examples CTR=0 should be a good time for you to read all of the current shunts.

    Regards,
    Cody 

  • Thanks for quick response,
    1-) but I turn the high-side drivers on in CTR=CAD and turn the low-side drivers on in CTR=CAU, so based on your answer i should read the low side current on CTR=CAU (EPwm1Regs.ETSEL.bit.SOCASEL=4) but it seems that it dose not work and reading in CTR=CAD (EPwm1Regs.ETSEL.bit.SOCASEL=5) work correct. I should be noted that EPwm1A is connected to high-side drivers of DRV8305 and i have connected bldc to 3 phase channels.
    2-) by this sentence: ''In our example software we center our low side gate driver pulse around zero'' ,are you using SVM?, can you tell me which example.
  • Mohammad,

        you want to read the current sometime after CTR= CAU, you will need to wait for the drivers to fully turn on.

    Take a look at instaSPIN, it does use SVM. 

    Regards,
    Cody 

  • Mohammad,

    I am going to close this thread due to inactivity. Feel free to respond here if it is not locked or start a related thread if you have not reached resolution.

    Regards,
    Cody