|
|
@@ -483,7 +483,7 @@ static __INLINE void PMSM_FOC_FieldWeak(void) {
|
|
|
static __INLINE float PMSM_FOC_Limit_iDC(float maxTrq) {
|
|
|
#if 1
|
|
|
PI_Ctrl_Power.max = maxTrq;
|
|
|
- float errRef = eRamp_get_intepolation(&gFoc_Ctrl.rtLim.DCCurrLimRamp) - gFoc_Ctrl.out.s_FilteriDC;
|
|
|
+ float errRef = eRamp_get_intepolation(&gFoc_Ctrl.rtLim.DCCurrLimRamp) - ABS(gFoc_Ctrl.out.s_FilteriDC);
|
|
|
return PI_Controller_run(gFoc_Ctrl.pi_power, errRef);
|
|
|
#else
|
|
|
return maxTrq;
|
|
|
@@ -1025,7 +1025,7 @@ void PMSM_FOC_Calc_Current(void) {
|
|
|
if (id_thr >= 100.0f) {
|
|
|
id_thr = 100.0f;
|
|
|
}
|
|
|
- float raw_idc = m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
|
|
|
+ float raw_idc = -m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
|
|
|
#else
|
|
|
float raw_idc = get_vbus_current();
|
|
|
#endif
|