minor changes to fault reporting

This commit is contained in:
Jeffrey M. Friesen 2020-06-06 17:38:53 -07:00
parent 9781fb9563
commit 6069b2f872
2 changed files with 7 additions and 6 deletions

View File

@ -73,8 +73,8 @@
//#define HW60_IS_MK3
//#define HW60_IS_MK4
#define HW_SOURCE "hw_60.c"
#define HW_HEADER "hw_60.h"
//#define HW_SOURCE "hw_60.c"
//#define HW_HEADER "hw_60.h"
//#define HW_SOURCE "hw_r2.c"
//#define HW_HEADER "hw_r2.h"
@ -137,9 +137,9 @@
//#define HW_SOURCE "hw_unity.c"
//#define HW_HEADER "hw_unity.h"
//#define HW_DUAL_CONFIG_PARALLEL
//#define HW_SOURCE "hw_stormcore_100d.c"
//#define HW_HEADER "hw_stormcore_100d.h"
#define HW_DUAL_CONFIG_PARALLEL
#define HW_SOURCE "hw_stormcore_100d.c"
#define HW_HEADER "hw_stormcore_100d.h"
//#define HW_SOURCE "hw_stormcore_60d.c"
//#define HW_HEADER "hw_stormcore_60d.h"

View File

@ -1609,6 +1609,7 @@ void mc_interface_mc_timer_isr(bool is_second_motor) {
// DRV fault code
#ifdef HW_HAS_DUAL_PARALLEL
if (IS_DRV_FAULT() || IS_DRV_FAULT_2()) {
is_second_motor = IS_DRV_FAULT_2();
#else
if (is_second_motor ? IS_DRV_FAULT_2() : IS_DRV_FAULT()) {
#endif
@ -1921,7 +1922,7 @@ static void update_override_limits(volatile motor_if_state_t *motor, volatile mc
float lo_max_mot = l_current_max_tmp;
if (motor->m_temp_motor < conf->l_temp_motor_start) {
// Keep values
} else if (motor->m_temp_motor > conf->l_temp_motor_end) {
} else if (motor->m_temp_motor > (conf->l_temp_motor_end + 10.0)) { // only fault if 10 degrees over max do give some cushion for noisey sensors
lo_min_mot = 0.0;
lo_max_mot = 0.0;
mc_interface_fault_stop(FAULT_CODE_OVER_TEMP_MOTOR, !is_motor_1, false);