diff --git a/motor/mc_interface.c b/motor/mc_interface.c index 5d06bd02..3277d522 100644 --- a/motor/mc_interface.c +++ b/motor/mc_interface.c @@ -734,7 +734,13 @@ void mc_interface_set_current_rel(float val) { } volatile mc_configuration *cfg = &motor_now()->m_conf; - mc_interface_set_current(val * cfg->lo_current_max); + float duty = mc_interface_get_duty_cycle_now(); + + if (fabsf(duty) < 0.02 || SIGN(val) == SIGN(duty)) { + mc_interface_set_current(val * cfg->lo_current_max); + } else { + mc_interface_set_current(val * fabsf(cfg->lo_current_min)); + } if (fabsf(val * cfg->l_abs_current_max) > cfg->cc_min_current) { mc_interface_set_current_off_delay(0.1);