⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ifoc_ti.c

📁 三相电机调速程序
💻 C
📖 第 1 页 / 共 3 页
字号:
-----------------------------------------------------------------------------*/
		ipark((void *)&v->voltage_DQt,(void *)&v->voltage_dq);

/*-----------------------------------------------------------------------------
Connect IPARK voltage outputs to the SVGENDQ inputs 
-----------------------------------------------------------------------------*/
    	v->svgen.d = v->voltage_dq.d;      
		v->svgen.q = v->voltage_dq.q;      
 		
/*-----------------------------------------------------------------------------
Call the compute function for the SVGENDQ
-----------------------------------------------------------------------------*/
    	v->svgen.calc((void *)&v->svgen); 	/* Call SVGENDQ compute function */

/*-----------------------------------------------------------------------------
Call the compute function for the CLARKE 
-----------------------------------------------------------------------------*/
		clark((void *)&v->current_abc,(void *)&v->current_dq);

/*-----------------------------------------------------------------------------
Connect currents in DQT structure  
-----------------------------------------------------------------------------*/
    	v->current_dqt.D = v->current_dq.d;
    	v->current_dqt.Q = v->current_dq.q;
    	v->current_dqt.theta = v->rg.rmp_out;

/*-----------------------------------------------------------------------------
Call the compute function for the PARK 
-----------------------------------------------------------------------------*/
		park((void *)&v->current_dqt,(void *)&v->current_DQ);

    }   /* End: constant_current==FALSE */

}  /* End: IFOC_TI_Run() */
#endif /* (BUILDLEVEL==LEVEL3) */


#if (BUILDLEVEL==LEVEL4)         
void IFOC_TI_Run(IFOC_TI_handle v)
{  

/*-----------------------------------------------------------------------------
Connect freq_testing inputs to the RMPCNTL  
-----------------------------------------------------------------------------*/
    v->rmpc.target_value = v->freq_testing;  

/*-----------------------------------------------------------------------------
Call the compute function for the RMPCNTL
-----------------------------------------------------------------------------*/
    v->rmpc.calc((void *)&v->rmpc); 	/* Call RMPCNTL compute function */

/*-----------------------------------------------------------------------------
Connect RMPCNTL output to the RAMPGEN input  
-----------------------------------------------------------------------------*/
    v->rg.rmp_freq = v->rmpc.setpt_value;  

/*-----------------------------------------------------------------------------
Call the compute function for the RAMPGEN
-----------------------------------------------------------------------------*/
    v->rg.calc((void *)&v->rg); 	/* Call RAMPGEN compute function */

/*-----------------------------------------------------------------------------
Connect PIDREG3 inputs for Id control  
-----------------------------------------------------------------------------*/
    v->pid_id.pid_ref_reg3 = v->my_id_ref;  
    v->pid_id.pid_fdb_reg3 = v->current_DQ.d;

/*-----------------------------------------------------------------------------
Call the compute function for the PIDREG3 inputs for Id control
-----------------------------------------------------------------------------*/
    v->pid_id.calc((void *)&v->pid_id); 	/* Call PIDREG3 compute function */

/*-----------------------------------------------------------------------------
Connect PIDREG3 inputs for Iq control  
-----------------------------------------------------------------------------*/
    v->pid_iq.pid_ref_reg3 = v->my_iq_ref;  
    v->pid_iq.pid_fdb_reg3 = v->current_DQ.q;

/*-----------------------------------------------------------------------------
Call the compute function for the PIDREG3 inputs for Iq control
-----------------------------------------------------------------------------*/
    v->pid_iq.calc((void *)&v->pid_iq); 	/* Call PIDREG3 compute function */

/*-----------------------------------------------------------------------------
Connect voltages in DQT structure  
-----------------------------------------------------------------------------*/
   	v->voltage_DQt.D = v->pid_id.pid_out_reg3;
   	v->voltage_DQt.Q = v->pid_iq.pid_out_reg3;
   	v->voltage_DQt.theta = v->rg.rmp_out;
      
/*-----------------------------------------------------------------------------
Call the compute function for the IPARK 
-----------------------------------------------------------------------------*/
	ipark((void *)&v->voltage_DQt,(void *)&v->voltage_dq);

/*-----------------------------------------------------------------------------
Connect IPARK voltage outputs to the SVGENDQ inputs 
-----------------------------------------------------------------------------*/
   	v->svgen.d = v->voltage_dq.d;      
	v->svgen.q = v->voltage_dq.q;      
 		
/*-----------------------------------------------------------------------------
Call the compute function for the SVGENDQ
-----------------------------------------------------------------------------*/
   	v->svgen.calc((void *)&v->svgen); 	/* Call SVGENDQ compute function */

/*-----------------------------------------------------------------------------
Call the compute function for the CLARKE 
-----------------------------------------------------------------------------*/
	clark((void *)&v->current_abc,(void *)&v->current_dq);

/*-----------------------------------------------------------------------------
Connect currents in DQT structure  
-----------------------------------------------------------------------------*/
   	v->current_dqt.D = v->current_dq.d;
  	v->current_dqt.Q = v->current_dq.q;
   	v->current_dqt.theta = v->rg.rmp_out;

/*-----------------------------------------------------------------------------
Call the compute function for the PARK 
-----------------------------------------------------------------------------*/
	park((void *)&v->current_dqt,(void *)&v->current_DQ);

/*-----------------------------------------------------------------------------
Connect CURRENT_MODEL inputs 
-----------------------------------------------------------------------------*/
  	v->cm.i_cur_mod_D = v->current_DQ.d;
  	v->cm.i_cur_mod_Q = v->current_DQ.q;
    v->cm.spd_cur_mod = v->Mea_spd;

/*-----------------------------------------------------------------------------
Call the compute function for the CURRENT_MODEL
-----------------------------------------------------------------------------*/
    v->cm.calc((void *)&v->cm);   /* Call CURRENT_MODEL compute function */ 

}  /* End: IFOC_TI_Run() */
#endif /* (BUILDLEVEL==LEVEL4) */
 

#if (BUILDLEVEL==LEVEL5)         
void IFOC_TI_Run(IFOC_TI_handle v)
{  

/*-----------------------------------------------------------------------------
Connect PIDREG3 inputs for speed control  
-----------------------------------------------------------------------------*/
   	v->pid_spd.pid_ref_reg3 = v->speed_reference;  
   	v->pid_spd.pid_fdb_reg3 = v->Mea_spd;

/*-----------------------------------------------------------------------------
Call the compute function for the PIDREG3 inputs for speed control
-----------------------------------------------------------------------------*/
   	v->pid_spd.calc((void *)&v->pid_spd); 	/* Call PIDREG3 compute function */

/*-----------------------------------------------------------------------------
Connect PIDREG3 inputs for Id control  
-----------------------------------------------------------------------------*/
    v->pid_id.pid_ref_reg3 = v->my_id_ref;  
    v->pid_id.pid_fdb_reg3 = v->current_DQ.d;

/*-----------------------------------------------------------------------------
Call the compute function for the PIDREG3 inputs for Id control
-----------------------------------------------------------------------------*/
    v->pid_id.calc((void *)&v->pid_id); 	/* Call PIDREG3 compute function */

/*-----------------------------------------------------------------------------
Connect PIDREG3 inputs for Iq control  
-----------------------------------------------------------------------------*/
    v->pid_iq.pid_ref_reg3 = v->pid_spd.pid_out_reg3;  
    v->pid_iq.pid_fdb_reg3 = v->current_DQ.q;

/*-----------------------------------------------------------------------------
Call the compute function for the PIDREG3 inputs for Iq control
-----------------------------------------------------------------------------*/
    v->pid_iq.calc((void *)&v->pid_iq); 	/* Call PIDREG3 compute function */

/*-----------------------------------------------------------------------------
Connect voltages in DQT structure  
-----------------------------------------------------------------------------*/
   	v->voltage_DQt.D = v->pid_id.pid_out_reg3;
   	v->voltage_DQt.Q = v->pid_iq.pid_out_reg3;
   	v->voltage_DQt.theta = v->cm.theta_cur_mod;
      
/*-----------------------------------------------------------------------------
Call the compute function for the IPARK 
-----------------------------------------------------------------------------*/
	ipark((void *)&v->voltage_DQt,(void *)&v->voltage_dq);

/*-----------------------------------------------------------------------------
Connect IPARK voltage outputs to the SVGENDQ inputs 
-----------------------------------------------------------------------------*/
   	v->svgen.d = v->voltage_dq.d;      
	v->svgen.q = v->voltage_dq.q;      

/*-----------------------------------------------------------------------------
Call the compute function for the SVGENDQ
-----------------------------------------------------------------------------*/
   	v->svgen.calc((void *)&v->svgen); 	/* Call SVGENDQ compute function */

/*-----------------------------------------------------------------------------
Call the compute function for the CLARKE 
-----------------------------------------------------------------------------*/
	clark((void *)&v->current_abc,(void *)&v->current_dq);

/*-----------------------------------------------------------------------------
Connect currents in DQT structure  
-----------------------------------------------------------------------------*/
   	v->current_dqt.D = v->current_dq.d;
  	v->current_dqt.Q = v->current_dq.q;
   	v->current_dqt.theta = v->cm.theta_cur_mod;

/*-----------------------------------------------------------------------------
Call the compute function for the PARK 
-----------------------------------------------------------------------------*/
	park((void *)&v->current_dqt,(void *)&v->current_DQ);

/*-----------------------------------------------------------------------------
Connect CURRENT_MODEL inputs 
-----------------------------------------------------------------------------*/
  	v->cm.i_cur_mod_D = v->current_DQ.d;
  	v->cm.i_cur_mod_Q = v->current_DQ.q;
    v->cm.spd_cur_mod = v->Mea_spd;

/*-----------------------------------------------------------------------------
Call the compute function for the CURRENT_MODEL
-----------------------------------------------------------------------------*/
    v->cm.calc((void *)&v->cm);   /* Call CURRENT_MODEL compute function */ 

}  /* End: IFOC_TI_Run() */
#endif /* (BUILDLEVEL==LEVEL5) */


  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -