diff --git a/Inc/config.h b/Inc/config.h index 41edc658..3a4217cf 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -69,13 +69,13 @@ #define FRAC_HIGH 30 #define FRAC_LOW 15 #define TS_COEF 1200 //12 for Kclamber Sensor -#define RIDEMODE RIDEMODE_BB_TORQUESENSOR +#define RIDEMODE RIDEMODE_PAS //#define TQONAD1 //------------------------------Throttle settings #define THROTTLE_OFFSET 900 #define THROTTLE_MAX 2600 -//#define THROTTLE_OVERRIDE +#define THROTTLE_OVERRIDE //-------------------------------Speed settings #define WHEEL_CIRCUMFERENCE 2200 @@ -84,7 +84,7 @@ #define PULSES_PER_REVOLUTION 1 #define REVERSE -1 #define SPEEDFILTER 1 -#define SPEEDSOURCE EXTERNAL +#define SPEEDSOURCE INTERNAL @@ -96,7 +96,7 @@ #define REGEN_CURRENT 0 #define REGEN_CURRENT_MAX 10000 #define PUSHASSIST_CURRENT 30 -#define VOLTAGE_MIN 1 +#define VOLTAGE_MIN 1200 //----------------------------- Display setting diff --git a/Src/main.c b/Src/main.c index 2a6bd49d..fa10e09c 100644 --- a/Src/main.c +++ b/Src/main.c @@ -2000,7 +2000,8 @@ void kingmeter_update(void) { ui8_Push_Assist_flag=0; } - i8_direction = KM.Settings.Reverse; + if( KM.Settings.Reverse)i8_direction = -1; + else i8_direction = 1; // MP.speedLimit=KM.Rx.SPEEDMAX_Limit; // MP.battery_current_max = KM.Rx.CUR_Limit_mA; @@ -2174,11 +2175,11 @@ void autodetect() { for (i = 0; i < 1080; i++) { q31_rotorposition_absolute += 11930465; //drive motor in open loop with steps of 1 deg HAL_Delay(5); - printf_("%d, %d, %d, %d\n", - switchtime[0], - switchtime[1], - i16_ph1_current, - i16_ph2_current); +// printf_("%d, %d, %d, %d\n", +// switchtime[0], +// switchtime[1], +// i16_ph1_current, +// i16_ph2_current); if (ui8_hall_state_old != ui8_hall_state) { printf_("angle: %d, hallstate: %d, hallcase %d \n",