Use fast speed estimator for hall sensors and encoder

This commit is contained in:
Benjamin Vedder 2020-04-16 12:16:02 +02:00
parent dd48276163
commit c64e7987bc
3 changed files with 7 additions and 6 deletions

View File

@ -21,6 +21,7 @@
* Inductance measurement scaling fix.
* Better flux linkage measurement.
* Improved battery level and range estimation.
* Use fast speed estimator for hall sensors and encoder transitions and interpolation.
=== FW 4.02 ===
* Position PID fix (most notable on multiturn encoders).

View File

@ -72,8 +72,8 @@
// Mark3 version of HW60 with power switch and separate NRF UART.
//#define HW60_IS_MK3
//#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,8 +137,8 @@
//#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_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

@ -2442,7 +2442,7 @@ void mcpwm_foc_adc_int_handler(void *p, uint32_t flags) {
motor_now->m_motor_state.phase = correct_encoder(
motor_now->m_phase_now_observer,
motor_now->m_phase_now_encoder,
motor_now->m_pll_speed,
motor_now->m_speed_est_fast,
conf_now->foc_sl_erpm,
motor_now);
} else {
@ -2456,7 +2456,7 @@ void mcpwm_foc_adc_int_handler(void *p, uint32_t flags) {
break;
case FOC_SENSOR_MODE_HALL:
motor_now->m_phase_now_observer = correct_hall(motor_now->m_phase_now_observer,
motor_now->m_pll_speed, dt, motor_now);
motor_now->m_speed_est_fast, dt, motor_now);
motor_now->m_motor_state.phase = motor_now->m_phase_now_observer;
if (!motor_now->m_phase_override) {