In my software, I have a parameter tuning thought. This is in case the motor I am controlling changes. Therefore, as long as KMS is in the IDLE state, and the motor is not being controlled, I let the master controller send me a list of motor parameters via SPI to store into the flash system params. I do this, and then recall DRV_INIT(). This does not seem to cause any problems, and most parameters change, however, I have identified 2 that do not, and want to be sure I am taking the correct steps to change parameters on the fly like this.
Currently, I am just calling DRV_Init() again after setting the new flashSysParams. Is there anything else I need to do?
The 2 that do not change are encoder pole pairs, as well as TRAJVEL Acceleration Limit, this process does not seem to work for these two parameters.
Do I need to do anything extra besides calling DRV_Init() after setting the flashSysParams value to change some of these parameters, such as the 2 listed above?
This is what I am doing:
flashSysParams->motorParams.polePairs = tuning_params[PARAM_MOTOR_POLE_PAIRS].tuningValue;
flashSysParams->trajvelCfg.limitAcc = _LQ(tuning_params[PARAM_ACCEL_LIM].tuningValue/FULL_SCALE_SPEED_RPM);
/* Init Platform Independent Motor Commander Core */
DRV_init(&flashSysParams);