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.

BOOSTXL-DRV8320RS: Confused about USER_ADC_FULL_SCALE_CURRENT_A / moduleOverCurrent

Part Number: BOOSTXL-DRV8320RS
Other Parts Discussed in Thread: LAUNCHXL-F280049C, , DRV8320

1)

The default value of USER_ADC_FULL_SCALE_CURRENT_A is:

//! \brief Defines the maximum current at the AD converter
//!        BOARD_BSXL8320RS_REVA, Gain=12
//#define USER_ADC_FULL_SCALE_CURRENT_A         ((float32_t)(42.843))

What I do not understand about this value is that the the ADC is biased at 1.65. So at zero volts, the ADC count is 2048 and 1/2 the ADC range is used. Doesn't that mean that a full scale ADC count of 4096 would correspond to 1/2 the above USER_ADC_FULL_SCALE_CURRENT_A? In other words the full scale is actually 21.4215 Amps?

The overcurrent control is set via the motorVars.dacValH to 2048 + 1024 + 512 + 256 - this corresponds around 18.744 Amps.

2)

The reason I ask about this is that like another user, we changed the R10, R11, and R12 from 0.007 to 0.3 in order to support a low current motor. No other changes made to the TI HW.

I changed the USER_ADC_FULL_SCALE_CURRENT_A from 42.843 to 1.0

As soon as I run is02_gain_offset and set the enable flag, the overcurrent fault occurs.

I set my USER_MOTOR_MAX_CURRENT_A to 0.4 A which should be under the overcurrent fault of 0.43

3) The lab is02 description says

"For this write-up,
AdcaResultRegs.ADCRESULT0, AdcbResultRegs.ADCRESULT0, and
AdccResultRegs.ADCRESULT0 are the motor phase current sampling results; these
three values are equal to half of the maximum ADC converter value since the
reference voltage of amplification circuits is 1.65V in 3.3V systems.
AdcaResultRegs.ADCRESULT1, AdcbResultRegs.ADCRESULT1,
AdccResultRegs.ADCRESULT1 are the motor phase voltage sampling results, and
these values are near 0 since there is no voltage output on the motor phases."

In my case, before I set the enabled flag, in the debugger...

ADCRESULT0 is around 2048 (thus around 0 A)

ADCRESULT1 is around 1280 which the debugger says is around 9V - this is 1/2 my dcBus_V

The lab says this should be 0 since there is no voltage output on the motor phases?

As I mentioned above, when I set motorVars.flagEnableSys=1, overcurrent fault occurs.

What current is the lab trying to use when measuring the offset?

4)

On the LAUNCHXL-F280049C, I have removed jumper JP1,JP2,JP3, and both jumpers from JP8. The BOOSTXL-DRV8320RS is connected to an 18V power supply.

The motor I am trying to use is

1 pole pair

18V

67mA no load current

0.6A max continuous current

5A stall current

  • Hi Ken,

    USER_ADC_FULL_SCALE_CURRENT_A typically refers to the full scale of minimum to maximum current represented by your ADC range, i.e. 0 to 3.3V. So if USER_ADC_FULL_SCALE_CURRENT_A  = 10.0A, then this represents 0 to 3.3V on the ADC (0 to 4096) = -5A to 5A, with 0-A corresponding to 1.65V. 

    Ensure that USER_ADC_FULL_SCALE_CURRENT_A corresponds with the correct VREF used in your application (3.3V for instance). Also ensure that your phase voltage and bus voltage feedback circuits correspond to the correct voltage scales as well depending on the resistor dividers used to ensure that you get the correct offsets when performing lab is02_gain_offset. 

    Setting USER_ADC_FULL_SCALE_CURRENT_A incorrectly typically corresponds to a software current limit that triggers overcurrent in software. 

    Forwarding to the C2000 for more input. 

    Thanks,
    Aaron



  • If you just change the shunt resistor, you may only need to re-calculate the USER_ADC_FULL_SCALE_CURRENT_A  with the formula as below

    USER_ADC_FULL_SCALE_CURRENT_A = 3.3/Rshunt/(11.0003)

    (11.0003) is the final gain for ADC input if the PGA is set to the (12), which equals to 12*27.4/(27.4+2.49), the values (27.4) and(2.49) are the resistors value on BOOSTXL-DRV8320RS for PGA input and reference.

    BTW, the (0.3)(OHM) is too high for your motor. You might try to use the (0.05)(OHM) shunt resistor, and set the USER_ADC_FULL_SCALE_CURRENT_A to (5.998)(A).

    USER_ADC_FULL_SCALE_CURRENT_A defines the maximum current at the AD converter which is represented by the maximum ADC input (3.3 V).

  • Why do you say 0.3ohm is too high, is it because of the stall current? If the nominal / continuous max current is 0.6A and no load current is only 67mA isn't that the ADC range I should target or maybe I am misunderstanding some concept. If I set the shunt resistor too low, I will not toggle many bits in the normal range of operation, correct?

    This motor did not work with the default 0.007ohm shunt.

    Also, isn't your reply a inconsistent with Aarons? For the stock board, even though USER_ADC_FULL_SCALE_CURRENT_A  = 42.843, isn't that really -21.4215 to 21.4215. Therefore 3.3V at the ADC represents 21.4215?

  • You should consider the maximum peak to peak current to design the circuit for USER_ADC_FULL_SCALE_CURRENT_A.

    The maximum continue current is 0.6A (RMS) as you mentioned above, so the peak to peak will be 0.6*2*sqrt(2), and you should reserve at least 50% margin. So you can use the 0.05 or 0.1 (OHM) shunt resistor.

  • Ok, I changed the shunt resistors to 0.05ohm as you suggested. Lab is02 ran and lab is05 identified the motor. However, after the motor id completes (motorVars.flagMotorIdentified=1), if I set motorVars.flagRunIdentAndOnLine=1 so that I can spin the motor, the motorVars.faultNow overcurrent immediately trips.

    I also tried lab is07 and overcurrent immediately trips.

    My user.h is:

    #define USER_ADC_FULL_SCALE_CURRENT_A         ((float32_t)(6.0))

    #define IA_OFFSET_A    (-3.02912951f)   // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A
    #define IB_OFFSET_A    (-3.04721594f)   // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A
    #define IC_OFFSET_A    (-3.03153658f)   // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A

    #define VA_OFFSET_V    (0.501742244f)    // ~=0.5
    #define VB_OFFSET_V    (0.501979232f)    // ~=0.5
    #define VC_OFFSET_V    (0.501339972f)    // ~=0.5

    #define USER_MOTOR_TYPE                   MOTOR_TYPE_PM
    #define USER_MOTOR_NUM_POLE_PAIRS         (1)
    #define USER_MOTOR_Rr_Ohm                 (0.0)
    #define USER_MOTOR_Rs_Ohm                 (1.6620779)
    #define USER_MOTOR_Ls_d_H                 (0.0395531915)
    #define USER_MOTOR_Ls_q_H                 (0.0395531915)
    #define USER_MOTOR_RATED_FLUX_VpHz        (5.35056877)

    #define USER_MOTOR_MAGNETIZING_CURRENT_A  (NULL)
    #define USER_MOTOR_RES_EST_CURRENT_A      (0.1)
    #define USER_MOTOR_IND_EST_CURRENT_A      (-0.1)
    #define USER_MOTOR_MAX_CURRENT_A          (0.4)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz       (97.0)

    // ???
    #define USER_MOTOR_INERTIA_Kgm2           (7.0e-09)

  • #define USER_ADC_FULL_SCALE_CURRENT_A         ((float32_t)(6.0))

    You should set the calculation value to this, don't make any round up. Check drvSPI8320Vars.Ctrl_Reg_05.VDS_LVL, motorVars.dacValH, and cmpssCnt, motorVars.dacValL.

    You might increase drvSPI8320Vars.Ctrl_Reg_05.VDS_LVL and motorVars.dacValH, and decrease motorVars.dacValL for increasing the over current protection value.

    For changing drvSPI8320Vars.Ctrl_Reg_05.VDS_LVL, find and refer to the following code in the lab main file.

        drvSPI8320Vars.Ctrl_Reg_05.VDS_LVL = DRV8320_VDS_LEVEL_1P300_V;

    Don't add any load on the motor to run it to see what happens. If have any further question, please share some testing waveform for the current captured by the oscilloscope with a current probe.

  • Other than changing the shunt resistor to what you suggested, the board is unchanged and I am trying with no load at all. That should be 67mA no load current for 57000rpm.

    I am not sure 6.0A versus 5.999836A makes a difference for USER_ADC_FULL_SCALE_CURRENT_A - that is within the tolerance of a resistor.

    The dacValH and dacValL are the default 3840 and 256. That is 2.62A correct? Even at max current of 0.6A for this motor, those values should not trip at all correct?

    I even tried 4086 and 10, no difference. The motor id part will complete, but when I try to set motorVars.flagRunIdentAndOnLine=1, it does nothing and the overcurrent fault is set. My external power supply which is set to current limit at 0.5A does not trip.

    This is the code/breakpoint that sets the moduleOverCurrent

           if(HAL_getPwmEnableStatus(halHandle) == true)
            {
                if(HAL_getTripFaults(halHandle) != 0)
                {
                    motorVars.faultNow.bit.moduleOverCurrent = 1;
                }
            }

    Unfortunately, I do not have a current probe.

  • I would like to add one more item - here is the motor:

    https://www.maxongroup.com/maxon/view/product/315173

    Notice it says:

    Terminal inductance

    0.0671 mH

    is05 motor id - reports

    motorVars.Ls_d_H of 0.0395531915

    Ls is units of Henry, not mH - why off by factor of 1000?

  • Yes, the unit is H. You might run the lab05 to identify the motor parameters, please make sure that the motor runs smoothly during the identification process. You have to monitor the motor phase current and share the testing waveform with use, that could help us to understand your question.

    For this low inductance motor, you need to use a higher PWM frequency.