Other Parts Discussed in Thread: DRV8323, BOOSTXL-DRV8323RS, BOOSTXL-DRV8323RH, LAUNCHXL-F280025C
Hello,
Some background:
I'm encountering an odd issue when attempting to use 2 DRV8323 gate drivers with a LUANCHXL-F280025C board. I'm mainly using the Universal Motor Control Lab code with some influence from dual motor control lab examples. What I am trying to do is run a motor with the DRV in booster pack connector site 1. The second booster pack is plugged in, configured in hal and initialized (PWM, ADC, CMPSS, etc) but not actively doing anything.
The problem:
Running a motor with the DRV8323RS in booster pack connector site 1 seems to work fine until I use calcMotorOverCurrentThreshold() for motor 2 in the main loop. The specific lines that seem to be "activating" the issue are 15 and 16:
//! \brief calculate motor over current threshold static inline void calcMotorOverCurrentThreshold(MOTOR_Handle handle) { MOTOR_SetVars_t *obj = (MOTOR_SetVars_t*) (handle->motorSetsHandle); float32_t overCurrent_A; overCurrent_A = obj->overCurrent_A; if (overCurrent_A > obj->maxPeakCurrent_A) { overCurrent_A = obj->maxPeakCurrent_A; } int16_t cmpValue = (int16_t) (overCurrent_A * obj->currentInv_sf); obj->dacCMPValH = 2048 + cmpValue; obj->dacCMPValL = 2048 - cmpValue; return; }
The symptoms I see are:
- when I turn on speed control for motor 1, the motor does not reach the reference speed (speedRef_Hz) of 40 Hz, instead it goes up to around 16Hz and stabilizes there.
- traj_spd_M1.intValue is 16 when it stabilizes
- If I manually increase traj_spd_M1.intValue to 40 Hz, the motor reaches the reference of 40.
- If it's running at 40 Hz, and I decrease the reference speed (speedRef_Hz) to 20 Hz, the motor reaches that speed without issue
- My conclusion from this is that the issue is specifically tied to increasing the speed reference, decreasing speed seems to work fine.
The weird part:
When I do not run calcMotorOverCurrentThreshold() on motor 2 in the main loop, motor 1 speed control works perfectly.
I'm not sure how these could possibly be related, any advice on where to look is appreciated. My first thought was I accidentally tied the CMPSS or ADC of motors 1 and 2 together, so I've made sure to go over all MTR1 and MTR2 ADC, SOC, PPB, CMP, XBAR values in hal to make sure they are unique between motors, and make necessary changes to HAL_setupADCs, HAL_setupCMPSSs, HAL_setupMtrFaults, HAL_setupPWMs to account for both booster packs.
I wouldn't be surprised if I missed something, but if someone knows what the possible connection could be I would appreciate any help or direction for where to look.
Let me know if any specific snippets of code could be useful for further troubleshooting.
Regards,