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.

Understanding the #define USER_ADC_FULL_SCALE_CURRENT_A (value) used in the DRV8301_69M_KIT_RevD vs. the LAUNCHXL-28069M kit( with a BOOSTXL_DRV8301 board)

Other Parts Discussed in Thread: DRV8301, MOTORWARE, TLV2781, BOOSTXL-DRV8301

I am using just MotorWare v1.01.00.14 code.  I am using both the DRV8301_69M_KIT and alternatively the LAUNCHXL_28069M kit (with a BOOSTXL_8301 board)

I am trying to understand the (value) used in each of the "user.h" and "user_j1.h" or "user_j5.h" for #define USER_ADC_FULL_SCALE_CURRENT_A (value)

C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\drv8301kit_revD\f28x\f2806xF\src\user.h has this statement
#define USER_ADC_FULL_SCALE_CURRENT_A (82.5)

while

C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\boostxldrv8301_revB\f28x\f2806xF\src\user_j1.h has this statement
#define USER_ADC_FULL_SCALE_CURRENT_A (33.0)

The "drv8301kit_RevD" board uses a 0.002 Ohm shunt resistor.  I only see a gain of x10 applied to that "shunt voltage" signal by the DRV8301 internal amplifier with it's default 10x gain.

The LaunchPad_69M with the "boostxldrv8301" board uses a 0.010 Ohm shunt resistor.  Again, I only see a gain of x10 applied to that "shunt voltage" signal by the DRV8301 internal amplifier with it's default 10x gain.

I think the "shunt voltage" signal using the "boostxldrv8301" board appears like it would be 5x the value of "shunt voltage" signal using the "drv8301kit_RevD" board.

So, here is the question  ...

Why isn't the statement in the
C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\drv8301kit_revD\f28x\f2806xF\src\user.h file:
#define USER_ADC_FULL_SCALE_CURRENT_A (165.0)
while
C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\boostxldrv8301_revB\f28x\f2806xF\src\user_j1.h has this statement
#define USER_ADC_FULL_SCALE_CURRENT_A (33.0)
?

Or, why isn't the statement in the
C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\boostxldrv8301_revB\f28x\f2806xF\src\user_j1.h file:
#define USER_ADC_FULL_SCALE_CURRENT_A (16.5)
while
C:\ti\motorware\motorware_1_01_00_14\sw\solutions\instaspin_foc\boards\drv8301kit_revD\f28x\f2806xF\src\user.h has this statement
#define USER_ADC_FULL_SCALE_CURRENT_A (82.5)
?

  • Hi Sean,
    I think you made an error in your current gain calculation for the DRV8301_69M-KIT. The board does not use the op-amps inside of the DRV-8301. If you look at the schematic which is part of the MotorWare package, you will see that external circuits using TLV2781 op-amps are used which provide a voltage gain of 20, not 10. This means that the current gain is equal to 20*0.002, which equals 0.04 volts per amp. If you divide this into the ADC maximum voltage of 3.3V, you get an ADC full-scale current value of 82.5 amps.
    Regards,Dave
  • Hi Dave,

    I can change the gain used by the DRV8301 and it changes the gain of the signal. I think that the op amps are used. I have looked at the schematic thoroughly and I do not see how EXT_IA-FB or EXT_IB-FB are used instead of IA-FB and IB-FB. I will check the software, but I think the A/D channels used are not the external signals. Otherwise, how could I change the gain used by the DRV8301 and see changes in the gain of those signals on the oscilloscope.

    On sheet 5 of 7 in the 515502~1.pdf (the schematic of this DRV8301_69M_KIT_RevD board), these connections are evident:

    On the DIMM100 connector:
    IA-FB => ADC-A1
    IA-FB => ADC-B3
    IB-FB => ADC-B1
    IB-FB => ADC-B5
    IC-FB => ADC-A3
    IC-FB => ADC-A5

    EXT_IA-FB => ADC-A6
    EXT_IB-FB => ADC-B6
    EXT_IC-FB => ADC-A0

    On the 20x2 HEADER - J5 there are NO EXT-... signals.

    In hal.c::HAL_setupAdcs():
    ...
    //configure the SOCs for drv8301kit_revD
    // EXT IA-FB
    ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_0,ADC_SocChanNumber_A6);
    ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_0,ADC_SocTrigSrc_EPWM1_ADCSOCA);
    ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_0,ADC_SocSampleDelay_9_cycles);

    // EXT IA-FB
    // Duplicate conversion due to ADC Initial Conversion bug (SPRZ342)
    ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_1,ADC_SocChanNumber_A6);
    ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_1,ADC_SocTrigSrc_EPWM1_ADCSOCA);
    ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_1,ADC_SocSampleDelay_9_cycles);

    // EXT IB-FB
    ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_2,ADC_SocChanNumber_B6);
    ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_2,ADC_SocTrigSrc_EPWM1_ADCSOCA);
    ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_2,ADC_SocSampleDelay_9_cycles);

    // EXT IC-FB
    ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_3,ADC_SocChanNumber_A0);
    ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_3,ADC_SocTrigSrc_EPWM1_ADCSOCA);
    ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_3,ADC_SocSampleDelay_9_cycles);
    ...

    You're right!

    Changing the DRV8301 gain means nothing, now, because the code uses the EXT_IA-FC, EXT_IB-FB, and EXT_IC-FB signals
    and the gain is x20

    Thanks, Dave.
  • Sean,
    For the DRV8301 EVM we use the external amplifiers, not the ones integrated into DRV8301.
    For BOOSTXL-DRV8301 we use the 2 internal and 1 external (if using 3rd current sensor for over-modulation).

    I think that's where you got confused.