|
|
@@ -12,6 +12,7 @@
|
|
|
#include "foc/mc_error.h"
|
|
|
#include "foc/motor/mot_params_ind.h"
|
|
|
#include "foc/mc_config.h"
|
|
|
+#include "foc/motor/throttle.h"
|
|
|
|
|
|
#ifdef CONFIG_DQ_STEP_RESPONSE
|
|
|
extern float target_d;
|
|
|
@@ -70,7 +71,9 @@ static void process_ext_command(foc_cmd_body_t *command) {
|
|
|
u8 b0 = decode_u8(command->data);
|
|
|
u8 p_mode = decode_8bits(b0, 0, 1);
|
|
|
if (p_mode == 1) {
|
|
|
- mc_start(CTRL_MODE_TRQ);
|
|
|
+ if (!mc_start(CTRL_MODE_TRQ)) {
|
|
|
+ mc_crit_err_add(FOC_START_Err_Code, (s16)(throttle_get_signal()*100.0f), (s16)PMSM_FOC_GetSpeed());
|
|
|
+ }
|
|
|
}else if (p_mode == 2) {
|
|
|
mc_stop();
|
|
|
}
|