Part Number: BOOSTXL-DRV8320RS
I am looking for a solution for a use-case that doesn't seem to work very well with the c2000 motor control SDK. I will have two different motor types that I need to be able to run without changing the macros in user.h. I can easily tell which motor is connected based on the Rs value obtained during motor identification, but after the Rs value is calculated I need to change some of the motor parameters so the rest of the motor identification process works correctly. I currently have the following code snippet that does not work:
if((motorVars.RsOnLine_Ohm < 2) && (motorVars.estState == EST_STATE_RS))
{
userParams.motor_numPolePairs = 8;
userParams.maxCurrent_A = 5.0;
userParams.maxCurrent_indEst_A = -2.0;
userParams.maxCurrent_resEst_A = 2.0;
userParams.fluxExcFreq_Hz = 40.0;
userParams.motor_Rs_d_Ohm = motorVars.Rs_Ohm;
userParams.motor_Rs_q_Ohm = motorVars.Rs_Ohm;
CTRL_setParams(ctrlHandle, &userParams);
}This code is in the main loop inside the condition "if(flagEstStateChanged == true)". The issue is that the function call to CTRL_setParams() makes the motor stop spinning during identification, but if I get rid of the function call then the parameters don't actually update and the rest of my identification process is wrong. My only idea to fix this right now is to start the motor identification, save Rs to flash memory after it is calculated, trigger the watchdog to reset the CPU, read the value of Rs from flash at startup, and finally set the motor parameters for the connected motor before doing the motor identification. I would hope there is an easier way to do this, but the SDK seems to abstracts so many details away that I can't really get a good understanding of where or what any of these variables really are. Please let me know if there is a simple way to do this or if I have to go with plan B.
Thank you,
James








