Fix vesc remote cruise control under erpm limit

This commit is contained in:
Benjamin Vedder 2021-11-13 00:56:01 +01:00
parent 3778dbe2e2
commit 8457331640
1 changed files with 5 additions and 1 deletions

View File

@ -313,7 +313,11 @@ static THD_FUNCTION(output_thread, arg) {
can_status_msg *msg = comm_can_get_status_msg_index(i);
if (msg->id >= 0 && UTILS_AGE_S(msg->rx_time) < MAX_CAN_AGE) {
comm_can_set_current(msg->id, current);
if (fabsf(pid_rpm) > mcconf->s_pid_min_erpm) {
comm_can_set_current(msg->id, current);
} else {
comm_can_set_duty(msg->id, 0.0);
}
}
}
}