|
|
@@ -11,6 +11,7 @@
|
|
|
#include "foc/core/foc_observer.h"
|
|
|
#include "foc/mc_error.h"
|
|
|
#include "foc/motor/mot_params_ind.h"
|
|
|
+#include "foc/samples.h"
|
|
|
|
|
|
#ifdef CONFIG_DQ_STEP_RESPONSE
|
|
|
extern float target_d;
|
|
|
@@ -64,7 +65,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_EV_MOS_Limit_L, PMSM_FOC_GetErrCode(), (s16)(get_throttle_float()*100.0f));
|
|
|
+ }
|
|
|
}else if (p_mode == 2) {
|
|
|
mc_stop();
|
|
|
}
|