|
|
@@ -581,8 +581,8 @@ static __INLINE void PMSM_FOC_idq_Assign(void) {
|
|
|
/*called in media task */
|
|
|
void PMSM_FOC_idqCalc(void) {
|
|
|
if (gFoc_Ctrl.in.b_AutoHold) {
|
|
|
- gFoc_Ctrl.pi_lock.max = CONFIG_DEFAULT_LOCK_TORQUE_LIM;
|
|
|
- gFoc_Ctrl.pi_lock.min = -CONFIG_DEFAULT_LOCK_TORQUE_LIM;
|
|
|
+ gFoc_Ctrl.pi_lock.max = CONFIG_MAX_LOCK_TORQUE;
|
|
|
+ gFoc_Ctrl.pi_lock.min = -CONFIG_MAX_LOCK_TORQUE;
|
|
|
float vel_count = motor_encoder_get_vel_count();
|
|
|
float errRef = 0 - vel_count;
|
|
|
gFoc_Ctrl.in.s_targetTorque = PI_Controller_Run(&gFoc_Ctrl.pi_lock ,errRef);
|