From d18ca7b4d71aed961d5bffd4a61a0a0fe985d301 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 10 Apr 2022 14:16:43 +0200 Subject: [PATCH] Bugfix to stop hard braking at high speeds --- BLDC_controller_ert_rtw/BLDC_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BLDC_controller_ert_rtw/BLDC_controller.c b/BLDC_controller_ert_rtw/BLDC_controller.c index ae63bd4..7e6be90 100644 --- a/BLDC_controller_ert_rtw/BLDC_controller.c +++ b/BLDC_controller_ert_rtw/BLDC_controller.c @@ -2124,7 +2124,7 @@ void BLDC_controller_step(RT_MODEL *const rtM) * Sum: '/Sum1' * Sum: '/Sum3' */ - rtb_Divide14_e = (uint16_T)(((int16_T)(DataTypeConversion2 - + rtb_Divide14_e = (uint16_T)(((int16_T)(rtP->r_fieldWeakHi - rtP->r_fieldWeakLo) << 15) / (int16_T)(rtP->r_fieldWeakHi - rtP->r_fieldWeakLo));