Skip to content

Commit

Permalink
optimize PI control
Browse files Browse the repository at this point in the history
  • Loading branch information
stancecoke committed Jan 4, 2025
1 parent 1155ea1 commit b4ab0ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
//---------------------------------------------------------------------
//power settings
#define PH_CURRENT_MAX 1200
#define BATTERYCURRENT_MAX 18000
#define BATTERYCURRENT_MAX 12000
#define REVERSE 1 //1 for normal direction, -1 for reverse
#define PUSHASSIST_CURRENT 300
#define VOLTAGE_MIN 1320 //33V
Expand Down
6 changes: 3 additions & 3 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ if(MP.com_mode==Sensorless_openloop||MP.com_mode==Sensorless_startkick)MS.Obs_fl
PI_id.setpoint = 0;
PI_id.limit_output = _U_MAX;
PI_id.max_step=5000;
PI_id.shift=10;
PI_id.shift=9;
PI_id.limit_i=1800;

PI_iq.gain_i=I_FACTOR_I_Q;
PI_iq.gain_p=P_FACTOR_I_Q;
PI_iq.setpoint = 0;
PI_iq.limit_output = _U_MAX;
PI_iq.max_step=5000;
PI_iq.shift=10;
PI_iq.shift=9;
PI_iq.limit_i=_U_MAX;

#ifdef SPEEDTHROTTLE
Expand Down Expand Up @@ -1014,7 +1014,7 @@ if(MP.com_mode==Sensorless_openloop||MP.com_mode==Sensorless_startkick)MS.Obs_fl
MS.i_q_setpoint,
MS.Speed,
ui_8_PLL_counter,
MS.Obs_flag,
MS.Battery_Current,
int32_temp_current_target ,
MS.i_q,
q31_angle_per_tic>>12,
Expand Down

0 comments on commit b4ab0ce

Please sign in to comment.