From 2620eed66c489c445c5d05ea3f85c7f88e1250b4 Mon Sep 17 00:00:00 2001 From: Euan Mutch Date: Fri, 19 Aug 2022 20:36:29 +0100 Subject: [PATCH] Fix typo on openloop current limit --- motor/mcpwm_foc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motor/mcpwm_foc.c b/motor/mcpwm_foc.c index 05a2f80f..aa2086a2 100644 --- a/motor/mcpwm_foc.c +++ b/motor/mcpwm_foc.c @@ -3346,7 +3346,7 @@ static void timer_update(motor_all_state_t *motor, float dt) { float openloop_current = fabsf(motor->m_motor_state.iq_filter); openloop_current += conf_now->foc_sl_openloop_boost_q; if (conf_now->foc_sl_openloop_max_q > 0.0) { - utils_truncate_number(&openloop_current, 0.0, conf_now->foc_sl_openloop_boost_q); + utils_truncate_number(&openloop_current, 0.0, conf_now->foc_sl_openloop_max_q); } float openloop_rpm_max = utils_map(openloop_current,