limit mc_interface_set_current_off_delay time to 5s

This commit is contained in:
Benjamin Vedder 2021-05-20 00:57:26 +02:00
parent bfe1fa0a12
commit fdad367c8d
2 changed files with 6 additions and 0 deletions

View File

@ -1564,6 +1564,11 @@ void mc_interface_set_current_off_delay(float delay_sec) {
return;
}
UTILS_NAN_ZERO(delay_sec);
if (delay_sec > 5.0) {
delay_sec = 5.0;
}
switch (motor_now()->m_conf.motor_type) {
case MOTOR_TYPE_BLDC:
case MOTOR_TYPE_DC:

View File

@ -2335,6 +2335,7 @@ void mcpwm_foc_print_state(void) {
commands_printf("Obs_x2: %.2f", (double)motor_now()->m_observer_x2);
commands_printf("vd_int: %.2f", (double)motor_now()->m_motor_state.vd_int);
commands_printf("vq_int: %.2f", (double)motor_now()->m_motor_state.vq_int);
commands_printf("off_delay: %.2f", (double)motor_now()->m_current_off_delay);
}
float mcpwm_foc_get_last_adc_isr_duration(void) {