Added hall sensor interpolation ERPM config option

This commit is contained in:
Benjamin Vedder 2020-10-22 08:37:32 +02:00
parent 1989a27994
commit af7cd36cb8
4 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,7 @@
* Added locking time and ramp up time parameters to sensorless startup.
* Removed D axis current injection.
* Initial VESC IO-board support
* Added hall sensor interpolation ERPM config option.
=== FW 5.01 ===
* Fixed PPM bug in previous release.

View File

@ -24,7 +24,7 @@
#define FW_VERSION_MAJOR 5
#define FW_VERSION_MINOR 02
// Set to 0 for building a release and iterate during beta test builds
#define FW_TEST_VERSION_NUMBER 10
#define FW_TEST_VERSION_NUMBER 12
#include "datatypes.h"

View File

@ -3991,7 +3991,8 @@ static float correct_hall(float angle, float dt, volatile motor_all_state_t *mot
motor->m_ang_hall_int_prev = ang_hall_int;
if (((60.0 / (2.0 * M_PI)) * ((M_PI / 3.0) /
fmaxf(fabsf(motor->m_hall_dt_diff_now), fabsf(motor->m_hall_dt_diff_last)))) < 100) {
fmaxf(fabsf(motor->m_hall_dt_diff_now),
fabsf(motor->m_hall_dt_diff_last)))) < conf_now->foc_hall_interp_erpm) {
// Don't interpolate on very low speed, just use the closest hall sensor. The reason is that we might
// get stuck at 60 degrees off if a direction change happens between two steps.
motor->m_ang_hall = ang_hall_now;

View File

@ -767,7 +767,8 @@ uint8_t utils_second_motor_id(void) {
* Use hall sensor port for second motor on dual motor hardware.
*
* @param samples
* The number of samples to read and filter over.
* The number of extra samples to read and filter over. If this
* is 0, only one sample will be used.
*
* @return
* The state of the three hall sensors.