使用2.0库驱动有感(1024线编码器)PMSM,可以开环运行(给固定的Uq,Ud)。
按照文档设置电流环PI参数,闭环转动一个随机角度就停止了。
void FOC_Model(void)
{
/**********STARTS THE VECTOR CONTROL ************************/
Stat_Curr_a_b = GET_PHASE_CURRENTS();
Stat_Curr_alfa_beta = Clarke(Stat_Curr_a_b);
Stat_Curr_q_d = Park(Stat_Curr_alfa_beta,GET_ELECTRICAL_ANGLE);
/*loads the Torque Regulator output reference voltage Vqs*/
Stat_Volt_q_d.qV_Component1 = PID_Regulator(3000,//Stat_Curr_q_d_ref_ref.qI_Component1,
Stat_Curr_q_d.qI_Component1,
&PID_Torque_InitStructure);
/*loads the Flux Regulator output reference voltage Vds*/
Stat_Volt_q_d.qV_Component2 = PID_Regulator(0,//Stat_Curr_q_d_ref_ref.qI_Component2,
Stat_Curr_q_d.qI_Component2,
&PID_Flux_InitStructure);
//开环运行
Stat_Volt_q_d.qV_Component1 = 1024;
Stat_Volt_q_d.qV_Component2 = 0;
//
//circle limitation
RevPark_Circle_Limitation();
/*Performs the Reverse Park transformation,
i.e transforms stator voltages Vqs and Vds into Valpha and Vbeta on a
stationary reference frame*/
Stat_Volt_alfa_beta = Rev_Park(Stat_Volt_q_d);
/*Valpha and Vbeta finally drive the power stage*/
CALC_SVPWM(Stat_Volt_alfa_beta);
}
哪位兄弟有这方面的经验,烦指点一下,那里的问题可能引起这个现象。
开环时的Iq,Id
闭环时的Iq,Id
|