Skip to content

Commit

Permalink
bugfix in regen at high speed
Browse files Browse the repository at this point in the history
  • Loading branch information
stancecoke committed Apr 18, 2024
1 parent 270a311 commit 4735701
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define VOLTAGE_MIN 1320 //33V

// motor current limits for invividual modes in mA, see default settings at https://max.cfw.sh/#
#define PH_CURRENT_MAX_ECO 150
#define PH_CURRENT_MAX_ECO 300
#define PH_CURRENT_MAX_NORMAL 900
#define PH_CURRENT_MAX_SPORT 1200

Expand Down
3 changes: 1 addition & 2 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,7 @@ if(MP.com_mode==Sensorless_openloop||MP.com_mode==Sensorless_startkick)MS.Obs_fl
#endif

//--------------------------------------------------------------------------------------------------------------------------------------------------

MS.i_q_setpoint_temp = map(uint32_tics_filtered >> 3, tics_higher_limit, tics_lower_limit, 0, MS.i_q_setpoint_temp); //ramp down current at speed limit
if(!MS.brake_active)MS.i_q_setpoint_temp = map(uint32_tics_filtered >> 3, tics_higher_limit, tics_lower_limit, 0, MS.i_q_setpoint_temp); //ramp down current at speed limit


MS.i_q_setpoint=map(MS.Temperature, 120,130,MS.i_q_setpoint_temp,0); //ramp down power with temperature to avoid overheating the motor
Expand Down

0 comments on commit 4735701

Please sign in to comment.