Part Number: TMS320F280049C
When I call HAL_getTripFaults(halHandle), I am getting 0b1100 returned. If both the Trip Zones One Shot flag, and Digital Compare A Event 1 flag are set, what do they mean? Any documentation on that will be helpful.
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.
Part Number: TMS320F280049C
When I call HAL_getTripFaults(halHandle), I am getting 0b1100 returned. If both the Trip Zones One Shot flag, and Digital Compare A Event 1 flag are set, what do they mean? Any documentation on that will be helpful.
That means an overcurrent fault has been trigged, and it's generated from the internal analog comparator which is configured in HAL_setupFaults() and HAL_setupCMPSSs(). You might find the detailed description of the registers in the F28004x technical manual at the link below.
TMS320F28004x Piccolo Microcontrollers Technical Reference Manual
Where and how is the maximum current value before tripping over current fault set?
The trip value is set in motorVars.dacValH and motorVars.dacValL.
motorVars.dacValH = 2048 + ((maximum current/USER_ADC_FULL_SCALE_CURRENT_A)*4096)
motorVars.dacValL = 2048 - ((maximum current/USER_ADC_FULL_SCALE_CURRENT_A)*4096)
The maximum current must be less than half of USER_ADC_FULL_SCALE_CURRENT_A.
You might find the following codes in the project main file of is0x_xxx.c, change the values of motorVars.dacValH and motorVars.dacValL as mentioned above.
//
// set internal DAC value for on-chip comparator for current protection
//
{
uint16_t cmpssCnt;
for(cmpssCnt = 0; cmpssCnt < HAL_NUM_CMPSS_CURRENT; cmpssCnt++)
{
HAL_setCMPSSDACValueHigh(halHandle,
cmpssCnt, motorVars.dacValH);
HAL_setCMPSSDACValueLow(halHandle,
cmpssCnt, motorVars.dacValL);
}
}
In MotorControlSDK, in file Hal.c, I see the below lines. Maximum current per your formula is 0? Very confusing. Please advice.
// Set the initial value to half of ADC range
uint16_t cmpsaDACH = 2048;
uint16_t cmpsaDACL = 2048;
It's just for CMPSS and PGA initial configuration. The value will be updated by the control codes mentioned above.
//! \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))
In lab.h,
I see the values as below. I guess this means the current limit is set to -18.744 amps to 18.744 amps. Thanks for your support.
2048 + 1024 + 512 + 256, /* dacValH */ \
2048 - 1024 - 512 - 256, /* dacValL */ \
Correct. You might change the values of these two variables for setting different overcurrent thresholds.