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.

TMS570LS3137: TMS570LS3137 DRV8301 ADC current sense problem

Part Number: TMS570LS3137
Other Parts Discussed in Thread: DRV8301

Hello,

I'm using project foc_encoder_speed.

1.

There is drv->adc_current_gain_A = 0.0000305176;

Why adc_current_gain_A  is 0.0000305176?

2.

// Update ADC object
adcGetData(adcREG1, adcGROUP1, obj->AdcResults1); // ((ADCmeas(q12)/2^12))*2
obj->adcData.I.value[0] = ((obj->AdcResults1[0].value<<4)-obj->cal_offset_A)*obj->adc_current_gain_A; // Phase A curr.
obj->adcData.I.value[1] = ((obj->AdcResults1[2].value<<4)-obj->cal_offset_B)*obj->adc_current_gain_B; // Phase B curr.

Is obj->adcData.I.value[0] is pu value or real value of A phase current?

3.

There are setting options for BASE_CURRENT based on DRV830x current-sense amplifier gain setting for F28069.

Can TMS570LS3137 set BASE_CURRENT like F28069?

Thank you.

 

  • Hi Rita,

    See comments below.

    1.

    There is drv->adc_current_gain_A = 0.0000305176;

    Why adc_current_gain_A  is 0.0000305176?

    >> This is just the default value (1/32k) that you can override using the GUI.

    2.

    // Update ADC object
    adcGetData(adcREG1, adcGROUP1, obj->AdcResults1); // ((ADCmeas(q12)/2^12))*2
    obj->adcData.I.value[0] = ((obj->AdcResults1[0].value<<4)-obj->cal_offset_A)*obj->adc_current_gain_A; // Phase A curr.
    obj->adcData.I.value[1] = ((obj->AdcResults1[2].value<<4)-obj->cal_offset_B)*obj->adc_current_gain_B; // Phase B curr.

    Is obj->adcData.I.value[0] is pu value or real value of A phase current?

    >> It is the real value of phase A current.

    3.

    There are setting options for BASE_CURRENT based on DRV830x current-sense amplifier gain setting for F28069.

    Can TMS570LS3137 set BASE_CURRENT like F28069?

    >> I am not aware of the implementation done on F28069.

  • Thank you for your rely.

    1.

    About question 2, why obj->adcData.I.value[0] is real value of A phase current?

    Why real value  of A phase current is not the obj->adcData.I.value[0] * BASE_CURRENT?

    In F28069+DRV8301,

    ADC_CURRENT  amplify by selecting DRV_GAIN,

    If DRV_GAIN = 80, then BASE_CURRENT = 10.3125.

    So, I can get A-phase current is the Ia * BASE_CURRENT.

    Why TMS570 + DRV8301  don't need to mutiply the BASE_CURRENT?

    2.

    How to change the DRV_GAIN in the 8301.c on the project foc_encoder_speed?

    How to set Control Register 2 for Current Shunt Amplifiers and Misc Control (Address: 0x03)?

    Thank you.

  • I am not familiar with the F28069 implementation for this control loop.

    There is a SPI interface between DRV8301 and TMS570LS3137. All configuration of DRV8301 registers is done via this interface in the DRV_setup function. The SPI interface is emulated using the High-End Timer (HET) module.

  • I don't see any configuration of DRV8301 registers via SPI interface in the DRV_setup function and  SPI interface between DRV8301 and TMS570LS3137.

    Where is SPI interface on project? 8301.c?

    Thank you.

  • Yes. This 8301.c file is generated using 8301.het, which has the HET program source code.

  • I found that configuration of DRV8301 registers via SPI interface is at 8301.het.

    ; Comment for SPIMO
    ; assume user wants to transfer out 0x5A5A = 0101 1010 0101 1010
    ; but the HET codes will shift out MSB first, this will be arrange in the HET codes as 25-bit data as
    ; 0101 1010 0101 1010 0000 0000 0
    ; thus it becomes 0x0B4B400. this is the values to be program to data field in order to transmit 0x5A5A
    ; DRV8301 Reg1 Write 0x13D8 => 0001 0011 1101 1000 0000 0000 0 => 0x027B000
    ; DRV8301 Reg1 Read 0x8000 => 1000 0000 0000 0000 0000 0000 0 => 0x1000000
    ; DRV8301 Reg1 Write 0x180D => 0001 1000 0000 1101 0000 0000 0 => 0x0301A00
    ; DRV8301 Reg1 Read 0x8000 => 1000 0000 0000 0000 0000 0000 0 => 0x1000000

    But I found that control register 2 had only 10-bit.

    Why DRV8301 Reg1 Write 0x180D => 0001 1000 0000 1101 0000 0000 0 => 0x0301A00

    has 16-bit?

    How to set 8301.het to generate the 8301.c and 8301.h?

  • I understand configuration of DRV8301 registers on 8301.het.

    How to set 8301.het to generate the 8301.c and 8301.h?

    Thank you.

  • I found that DRV8301 Reg2 Write 0x180D => 0001 1000 0000 1101 0000 0000 0 => 0x0301A00

    Control Register 2 for Current Shunt Amplifiers and Misc Control D3 = 1  D2 = 1.

    It means GAIN is 80V/V.

    If DRV_GAIN = 80, then BASE_CURRENT = 10.3125.

    So, I can get A-phase current is the Ia * BASE_CURRENT.

    Is it right for TMS570 + DRV8301?

    Thank you.

  • You can override the default current_gain with this value. The max operating current supported in the demo may have been limited by the power supply brick included with the kit. We don't have the design document for this demo as it was done a long time back (~2012).