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

📄 rmp_cntl.c

📁 在ccs编程环境下
💻 C
字号:

#include "IQmathLib.h"         /* Include header for IQmath library */
/* Don't forget to set a proper GLOBAL_Q in "IQmathLib.h" file */
#include "rmp_cntl.h"

void rmp_cntl_calc(RMPCNTL *v)
{	

	
      if (((v->target_value - v->setpt_value)>_IQ(0.0005))||((v->target_value - v->setpt_value)<-_IQ(0.0001)))
      {
         v->rmp_delay_cntl += 1;
         if (v->rmp_delay_cntl >= v->rmp_dly_max)
         {
           if (v->target_value > v->setpt_value)
           {
            v->setpt_value += _IQ(0.0005);  /* 0.0000305 is resolution of Q15 */
            if (v->setpt_value > v->rmp_hi_limit)
              v->setpt_value = v->rmp_hi_limit;           
            v->rmp_delay_cntl = 0;
           }
           else
           {
            v->setpt_value -= _IQ(0.0005);  /* 0.0000305 is resolution of Q15 */
            if (v->setpt_value < v->rmp_lo_limit)
              v->setpt_value = v->rmp_lo_limit;           
            v->rmp_delay_cntl = 0;
           }
         }        
      }
      else  v->s_eq_t_flg = 0x7FFFFFFF; 
}


⌨️ 快捷键说明

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