|
@@ -252,7 +252,7 @@ static void process_foc_command(foc_cmd_body_t *command) {
|
|
|
{
|
|
{
|
|
|
u8 mode = decode_u8(command->data);
|
|
u8 mode = decode_u8(command->data);
|
|
|
sys_debug("ctl mode = %d, len = %d\n", mode, command->len);
|
|
sys_debug("ctl mode = %d, len = %d\n", mode, command->len);
|
|
|
- if (!mc_set_foc_mode(mode)) {
|
|
|
|
|
|
|
+ if (!mc_set_ctrl_mode(mode)) {
|
|
|
erroCode = mot_contrl_get_errcode(&motor.controller);
|
|
erroCode = mot_contrl_get_errcode(&motor.controller);
|
|
|
}
|
|
}
|
|
|
response[len++] = motor.controller.mode_req;
|
|
response[len++] = motor.controller.mode_req;
|
|
@@ -445,12 +445,12 @@ static void process_foc_command(foc_cmd_body_t *command) {
|
|
|
u8 start = decode_u8((u8 *)command->data);
|
|
u8 start = decode_u8((u8 *)command->data);
|
|
|
if (start == 1) {
|
|
if (start == 1) {
|
|
|
sys_debug("start mpta cali\n");
|
|
sys_debug("start mpta cali\n");
|
|
|
- if (mc_set_foc_mode(CTRL_MODE_CURRENT)) {
|
|
|
|
|
|
|
+ if (mc_set_ctrl_mode(CTRL_MODE_CURRENT)) {
|
|
|
mot_contrl_mtpa_calibrate(&motor.controller, true);
|
|
mot_contrl_mtpa_calibrate(&motor.controller, true);
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
mot_contrl_mtpa_calibrate(&motor.controller, false);
|
|
mot_contrl_mtpa_calibrate(&motor.controller, false);
|
|
|
- mc_set_foc_mode(CTRL_MODE_TRQ);
|
|
|
|
|
|
|
+ mc_set_ctrl_mode(CTRL_MODE_TRQ);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|