diff --git a/.github/workflows/generate_bin.yml b/.github/workflows/generate_bin.yml index 284a166f..5aaddd8a 100644 --- a/.github/workflows/generate_bin.yml +++ b/.github/workflows/generate_bin.yml @@ -2,9 +2,9 @@ name: C/C++ CI on: push: - branches: [ master ] + branches: [ v0.5 ] pull_request: - branches: [ master ] + branches: [ v0.5 ] jobs: build: diff --git a/Core/Inc/config.h b/Core/Inc/config.h index e53e77bf..6ab27561 100644 --- a/Core/Inc/config.h +++ b/Core/Inc/config.h @@ -47,27 +47,27 @@ #define GEAR_RATIO 11 //15 for original M365 motor // speed limits for invividual modes in kph -#define SPEEDLIMIT_ECO 6 +#define SPEEDLIMIT_ECO 15 #define SPEEDLIMIT_NORMAL 20 #define SPEEDLIMIT_SPORT 50 -// motor current limits for invividual modes in mA -#define PH_CURRENT_MAX_ECO 5000 -#define PH_CURRENT_MAX_NORMAL 9000 -#define PH_CURRENT_MAX_SPORT 14000 +// motor current limits for invividual modes in mA, see default settings at https://max.cfw.sh/# +#define PH_CURRENT_MAX_ECO 16000 +#define PH_CURRENT_MAX_NORMAL 28000 +#define PH_CURRENT_MAX_SPORT 55000 // motor current limit for regen in mA -#define REGEN_CURRENT 20000 +#define REGEN_CURRENT 2000 // maximum current for flux weakening in mA -#define FW_CURRENT_MAX 18000 //max id +#define FW_CURRENT_MAX 12000 //max id // maximum battery currents in mA -#define BATTERYCURRENT_MAX 8000 +#define BATTERYCURRENT_MAX 25000 #define REGEN_CURRENT_MAX 10000 // battery voltage limits in mV -#define BATTERYVOLTAGE_MIN 33000 +#define BATTERYVOLTAGE_MIN 31000 #define BATTERYVOLTAGE_MAX 42000 diff --git a/Core/Src/main.c b/Core/Src/main.c index a2858918..5a0497b0 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -616,7 +616,7 @@ int main(void) { #ifdef ADCTHROTTLE - MS.i_q_setpoint=map(ui16_reg_adc_value,THROTTLEOFFSET,THROTTLEMAX,0,MS.phase_current_limit); + MS.i_q_setpoint=map(ui16_reg_adc_value,THROTTLEOFFSET,THROTTLEMAX,0,MP.phase_current_limit); #endif // set power to zero at low voltage if(MS.Voltage